简体   繁体   English

如何使用Matlab绘制输入[-1 0 1]?

[英]how to plot input [-1 0 1] using Matlab?

my data matrix has 19 rows and 396 columns.

row 1=[0 -1 0 1......]
row 2=[1 0 -1 1 1 0...]
.
.
row 19=[1 -1 0 1 0 0..]

how should I code this using plot function in Matlab ? 我应该如何在Matlab中使用plot函数对此进行编码? given below: 如下:

if(bit==1)
   X axis= X++;
   Y axis= Y++;
   /*graph will show increment by 1 */
else if (bit==-1)
  X axis = X++;
  Y axis = Y--;
  /* graph will show decrements by 1*/
A = randi(2,10,10); %// create random matrix with ones and twos
A(A==2)=0;          %// set 2 to 0
imagesc(A)          %// plot your binary matrix

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM