Extract Excel files to Matlab skript
1 次查看(过去 30 天)
显示 更早的评论
I would like to import some commands from Excel into for loop and then execute these commands. These commands have different lengths that is why I need several loops for those lengths.
Can anybody help me please??
1 个评论
回答(1 个)
Image Analyst
2017-9-5
We probably can help you. So read this link and then get back to us with a file attached, and what commands you'd like to execute on the imported data. But does your Excel file have numerical data in it, or the actual commands themselves?
If the commands you want to execute are actually text in the Excel cells, for example cell A1 has msgbox('Hello from Excel') in it and you want to execute
msgbox('Hello from Excel')
then you'll have to use eval().
[numbers, commands, raw] = xlsread(filename);
% Execute command in cell A1
eval(commands(1,1));
2 个评论
Image Analyst
2017-9-5
It looks like you're building a cell array from a ton of variables. You didn't attach your workbook so I can't see what's in it. And you also didn't even show the code where you called xlsread() or readtable() to read in the workbook. I can't help, given what you've supplied (so far).
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!