- printmat is not a matlab built-in function, so we have no idea what it is supposed to do.
Matlab 2012 crate table
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm trying to create a table which shows my result in gui.I am using matlab 2012 so i cant use 'table' command and then i tried 'printmat' command. It returns empty folder when i run the code. Is there anyone can solve my problem?
Thanks in advance.
This is a simple formula for my case.
x=fopen('untitled.xls','wt');
m=str2double(get(handles.edit1,'String'));
V=str2double(get(handles.edit2,'String'));
d=m/V;
FR=[m V d];
printmat(x,'FR');
fclose(x);
1 个评论
Guillaume
2017-9-13
编辑:Guillaume
2017-9-13
You haven't defined what a table is. The table class in matlab was introduced in R2013b. Short of you writing your own table class that behaves the same way (would be a lot of work) you can't use that in R2012. There is no table data type in R2012 so we're left guessing what it is you want.
Your code (not formula) snippet is not really helpful because: * you appear to open an excel file using fopen. Unless you know the internal binary format of excel files and intend to write the entire content yourself, you're not going to get anywhere with that. You could write an excel file with xlswrite.
Is your question actually: how to write an excel file?
采纳的回答
Guillaume
2017-9-13
Complete guess as your question is very unclear: You're trying to write an excel file. In which case:
m = str2double(get(handles.edit1,'String'));
V = str2double(get(handles.edit2,'String'));
xlswrite('untitled.xls', [m, V, m/V]);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!