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

3 ビュー (過去 30 日間)
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.

回答 (1 件)

Image Analyst
Image Analyst 2023 年 1 月 30 日
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:

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by