Why is my "plot" function not working?
显示 更早的评论

T = readtable('ELG3155_LAB3_part2_M_2V.xlsx', 'PreserveVariableNames', true);
x = T.("Time (ms)");
y = T.("Raw speed (mrad/s)");
grid on;
plot(x,y);
When i run this it says there is an error with my plot function, why?
采纳的回答
更多回答(1 个)
Walter Roberson
2023-3-26
0 个投票
The first row has time 00. That is text not numeric.
Looking at the left justification it looks to me as if the second column is text rather than numeric.
1 个评论
Walter Roberson
2023-3-26
I checked in Excel itself, and sure enough, the 00 gives a warning about "Number stored as text", and all of columns 2, 3, 4 report the same thing.
If you use readmatrix() then everything will be converted to numeric.
Note: with default options, the 00 0 0 0 row will be detected as being header and will be skipped.
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
