I want to plot soil moisture against daytime values but I am getting "Do indexing is not supported for variables of this type".

4 Ansichten (letzte 30 Tage)
SM_05 = table2array(all(:,7))/100;
d = datetime(date.Var6,'Format','yyyy-MM-dd''T''HH:mm:ss''Z');
plot(d,SM_05.Var7);
The last code does not run.

Antworten (1)

Image Analyst
Image Analyst am 30 Jan. 2023
date is a function and does not have methods, like Var6(). And SM_05 is a column vector, not a table so there is no Var7 column anymore. Var7 was part of "all" but not part of the SM_05 matrix you converted the table into. Perhaps the "all" table has a column called date in which case you'd do
SM_05 = table2array(all(:,7))/100; % SM_05 is now a double matrix, not a table.
d = datetime(all.date.Var6,'Format','yyyy-MM-dd''T''HH:mm:ss''Z');
plot(d,SM_05, 'b.-', 'LineWidth', 2);
If you have any more questions, then attach your data (the "all" matrix) and code to read it in with the paperclip icon after you read this:

Kategorien

Mehr zu Graphics Performance 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!

Translated by