Error using plot Invalid subscript for Y.
66 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Utsav Lakhlani
am 9 Mai 2022
Kommentiert: Utsav Lakhlani
am 11 Mai 2022
I imported data using import data funtion and want plot FO2_Odometer vs 1st sensor ,I keep getting this error please help me
4 Kommentare
Rik
am 9 Mai 2022
Casting to double might be enough. If you had posted your code as code instead of a screenshot I would have done that for you.
Akzeptierte Antwort
Rik
am 9 Mai 2022
Let's generate some data and try my suggestion of casting to double:
%generate data
FO2_Odometer=rand(10,1);Caliper1=rand(10,1);Caliper2=rand(10,1);Caliper3=rand(10,1);
Dataset0=table(FO2_Odometer,Caliper1, Caliper2, Caliper3)
% extract the data and try casting to double
sensors = Dataset0(:,2:4);
FO2_Odometer = Dataset0(:,1);
try
double(FO2_Odometer)
catch ME,fprintf('Error using tabular/double\n%s\n',ME.message),end
Oops. An error. Luckily, it provides a suggestion to extract the data.
Since the error message suggests this, let's try it:
FO2_Odometer=table2array(FO2_Odometer);
sensors=table2array(sensors);
plot(FO2_Odometer,sensors(:,1),'*')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Timetables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!