简体   繁体   中英

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 ? 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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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