Why I got the error "Operator '-' is not supported for operands of type 'struct'."?
39 次查看(过去 30 天)
显示 更早的评论
My code
%Convert from Fahrenheit to Kelvin
TempK = ((X(:,1)-32)*5/9)+273.15;
6 个评论
采纳的回答
Cris LaPierre
2020-5-8
编辑:Cris LaPierre
2020-5-8
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 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!