Why I got the error "Operator '-' is not supported for operands of type 'struct'."?
33 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ryan Scott
am 8 Mai 2020
Beantwortet: Sulaymon Eshkabilov
am 8 Mai 2020
My code
%Convert from Fahrenheit to Kelvin
TempK = ((X(:,1)-32)*5/9)+273.15;
6 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 8 Mai 2020
Bearbeitet: Cris LaPierre
am 8 Mai 2020
When importing a spreadsheet, importdata returns a scalar structure array (see here). Your error, then, is because you are not accessing the data properly (see examples on the page I linked to).
Is there a reason you are using this import function? I'd suggest using readtable instead. You will have to learn how to access data in a table as well. I'd suggest this short video.
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!