I want to plot soil moisture against daytime values but I am getting "Do indexing is not supported for variables of this type".
3 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Image Analyst
on 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:
0 Comments
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!