Effacer les filtres
Effacer les filtres

Unrecognized table variable name 'time'

24 vues (au cours des 30 derniers jours)
MOHAMMAD ABDUL MOKTADIR CHOWDHURY
Hi, I want to plot a time space diagram showing speed. First row is postmile (yvar), first row, first column is time (xvar), and other value are cvar.
I have writhe the readtable function. In workspace time table is there but I got the following error message:
My code and error message:
Snapshot of my heatmap3.csv file
Could you please advise what's wrong wiht my code?
Thanks

Réponse acceptée

Walter Roberson
Walter Roberson le 27 Mar 2021
Your csv file happears to have no header line, so the variable names created are Var1, Var2, and so on.
You are also attempting to color according to an array, not according to a single variable.
time = T{2:end,1};
postmile = T{1,2:end};
speed = T{2:end,2:end};
h = heatmap(time, postmile, speed);
  3 commentaires
Walter Roberson
Walter Roberson le 27 Mar 2021
time = T{2:end,1};
postmile = T{1,2:end};
speed = T{2:end,2:end}.';
h = heatmap(time, postmile, speed);
MOHAMMAD ABDUL MOKTADIR CHOWDHURY
Thanks a lot Walter
Its workig now

Connectez-vous pour commenter.

Plus de réponses (1)

MOHAMMAD ABDUL MOKTADIR CHOWDHURY
Thanks a lot Walter.
It is working now.

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by