Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
1 次查看(过去 30 天)
显示 更早的评论
Hi, Im trying to get matlab to read my excel file but it keeps coming up with the above error message. Not sure how to recitfy it, please help!
0 个评论
回答(1 个)
Yongjian Feng
2021-7-28
Try to initialize Y first?
Y = zeros(size_determined_by_your_Data, 6);
2 个评论
Yongjian Feng
2021-7-29
编辑:Yongjian Feng
2021-7-29
Note that log(Data(:,6)) has the same size of Data(:, 6). But diff(log(Data(:, 6))) has one less. If your Data(:, 6) has size of n, then diff(log(Data(:, 6))) has size of n-1. Most likely the error is caused by this difference.
In other words, your Y shall be initialized with this in mind.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!