??? Error using ==> plot Invalid first data argument error
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mekala balaji
am 31 Okt. 2014
Beantwortet: Mekala balaji
am 31 Okt. 2014
I have the following code
for k=1:size(Desc,1) %Data_All{j}(i,1)=strcat(Desc{i}(1,:)); Data_All1{j}{k,1}=strcat(Desc{k}(1,:)); Data_All1{j}{k,2}=strcat(Dataopen{k}(1,:)); Data_All2{j}{k,1}=strsplit((Data_All1{j}{k,2}),' '); A{j}{k,1}=Data_All2{j}{k,1}; C3{j}{k,1}=A{j}{k,1}{2}; a1=C3{1}{1,1}; a2=C3{1}{1,1}; plot(a1,a2); Data_All1{j}{k,3}=strcat(Dataend{k}(1,:));
end
but i am getting ??? Error using ==> plot Invalid first data argument
can anyone help
0 Kommentare
Akzeptierte Antwort
Geoff Hayes
am 31 Okt. 2014
Mekala - please format the above code so that it is readable. Highlight the code and press the {} Code button.
As well, please describe what your inputs are. Desc and Dataopen appear to be cell array of strings. Is this the case? Where is j initialized? If I run the above code, will it reproduce the error message that you have provided?
Given your use of strcat, strsplit, and naming of the variable Desc (for description?) it would appear that all of your arrays are populated with strings. This would include a1 and a2 which are inputs to the plot function
plot(a1,a2);
If I try to pass strings (character arrays) to this function as
plot('hello','world');
then I observe the same error as you
Error using plot
Invalid first data argument
The error is appropriate. Is this what you are doing, and if so, what are you trying to plot?
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!