Z must be a matrix, not scalar or vector - SURF
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sclay748
am 27 Okt. 2020
Kommentiert: Sclay748
am 27 Okt. 2020
Hello,
Attached is a screenshot of my code and a table I recreated in excel. Just pretend it is in MATLAB. Unfortunaltly, because this is for work, I cannot share actual screenshots, so I made a simplified mock up to show you.
'b' is the variable name I call from.
'c' is just what I call the length of b, which is 12.
The table is a 1x12 structure with 12 fields. For my example, I only show 1 to 5, but you ge the idea to show you where I get the error 'Z must be a matrix, not scalar or vector.'
I appreciate any help/advice. Thanks!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/394238/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/394243/image.png)
.....
0 Kommentare
Akzeptierte Antwort
Sindar
am 27 Okt. 2020
struct array is a terrible way to store this data. Does this do it?
tbl = struct2table(b);
surf(tbl.temperature,tbl.humidity,tbl.frequency)
% no loop
4 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!