Matlab 2012 crate table

1 次查看(过去 30 天)
HSukas
HSukas 2017-9-13
评论: HSukas 2017-9-13
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
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.
  • printmat is not a matlab built-in function, so we have no idea what it is supposed to do.
Is your question actually: how to write an excel file?

请先登录,再进行评论。

采纳的回答

Guillaume
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]);
  1 个评论
HSukas
HSukas 2017-9-13
Yes i am trying to create an excell file. In this file i want to show my results. xlswrite is worked. Thank you.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by