draw a graph from cell arrays

1 visualizzazione (ultimi 30 giorni)
Lev Mihailov
Lev Mihailov il 24 Lug 2019
Modificato: Lev Mihailov il 25 Lug 2019
Hello! Revenge has an array of cells and for them I need to make a graph, -10 first values ​​from my position and +10 meanings
[min,position]=min(Egida)
X=cell(1);
Y=cell(1);
%tenscribbles array of data equal to 10
for i = 1:length(min)-1
if position(i)+ftenscribbles(i)>tenscribbles(i);
mn=Egida((position(i)-tenscribbles(chek):c(i)),i) ;
nmm=Egida(position(i):position(i)+tenscribbles(i),i) ;
X{i}=xx;
Y{i}=nmm;
else c(i)+tenscribbles(i)<tenscribbles(i) ;
xx=0 ;
yy=0 ;
X{i}=xx;
Y{i}=yy;
end
figure1
plot(X{i},position);
grid on;
figure2
plot((Y{i},position););
grid on;
The data array looks like this [0,0,0, {[64 34 25 40 ...]}, 0, {...]
Error Expression or statement is incorrect--possibly unbalanced (, {, or [.
but I don't know how else you can do this

Risposte (1)

Stephen23
Stephen23 il 24 Lug 2019
Modificato: Stephen23 il 24 Lug 2019
plot((Y{i},position););
% ^ ^^ not valid syntax
should be
plot(Y{i},position);
PS: in future please show the complete error message. This means all of the red text. It contains information that helps us to understand where and why the error occured.
  2 Commenti
Lev Mihailov
Lev Mihailov il 25 Lug 2019
Modificato: Lev Mihailov il 25 Lug 2019
[min,position]=min(Egida)
X=cell(1);
Y=cell(1);
%tenscribbles array of data equal to 10
for i = 1:length(min)-1
if position(i)+ftenscribbles(i)>tenscribbles(i);
mn=Egida((position(i)-tenscribbles(chek):c(i)),i) ;
nmm=Egida(position(i):position(i)+tenscribbles(i),i) ;
X{i}=xx;
Y{i}=nmm;
else c(i)+tenscribbles(i)<tenscribbles(i) ;
xx=0 ;
yy=0 ;
X{i}=xx;
Y{i}=yy;
end
figure1
plot(X{i},position);
grid on;
Error using plot
Vectors must be the same length.
gives a fat error. sizes of position 1x800 double and X{i} 1x800 cell
p.s1.I noticed that even the 'plot' itself can’t do X {i}
p.s2 in another program I built a graph (an example provided it), yellow is +10 values, and green is 10, I want to do this in a matlab environment
Stephen23
Stephen23 il 25 Lug 2019
"...and X{i} 1x800 cell"
plot does not accept cell array input arguments. Its input arguments must be numeric.

Accedi per commentare.

Categorie

Scopri di più su Creating, Deleting, and Querying Graphics Objects in Help Center e File Exchange

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by