Exporting and save Data from Matlab to Excel

5 ビュー (過去 30 日間)
Honest Jimu
Honest Jimu 2020 年 1 月 25 日
回答済み: Bilal Osumanu 2021 年 7 月 26 日
I am new to Matlab, i am using MATLAB 2017a version. I want to write a code that is going to export and save my data to an excel file in any location on my computer.

回答 (3 件)

BN
BN 2020 年 1 月 25 日
Hey, if you want to save Nameofyourdata to the directory E:\mydirectoryname. You can use fullfile
dir = 'E:\mydirectoryname'; %where to save? in windows using \ and in linux using /
if ~exist(dir2, 'dir')
mkdir(dir2);
end
baseFileName = 'Example.xlsx'; % what would you like the name of your excel file?
fullFileName = fullfile(dir2, baseFileName);
writetable(Nameofyourdata,fullFileName); % insert name of your data instead of Nameofyourdata

Honest Jimu
Honest Jimu 2020 年 1 月 25 日
I want it to save on a windows computer. 6x1
Test_Number = {'VT079'};
Mean = {38};
Std = {222};
Var = {100};
Kurtosis = {122};
Skewnes = {120};
varNames = {'Mean','Std','Var','Kurtosis','Skewnes'};
T = table(Test_Number,Mean,Std,Var,Kurtosis,Skewness,'VariableNames',varNames);
and i want the table to look like the attached shown results in picture.
  1 件のコメント
BN
BN 2020 年 1 月 26 日
mybe this is useful for you
T = cell2table({}); %creating empthy table
Test_Number = {'VT079'};
Mean = {38};
Std = {222};
Var = {100};
Kurtosis = {122};
Skewnes = {120};
T.Test_number = Test_Number;
T.Mean = Mean;
T.Std = Std;
T.Var = Var;
T.Kurtosis = Kurtosis;
T.Skewnes = Skewnes;
T %Show Table

サインインしてコメントする。


Bilal Osumanu
Bilal Osumanu 2021 年 7 月 26 日
hey i'm using matlab version (2021a) and want to export data to excel but i keep on getting this:
Error using xlswrite (line 192)
An error occurred while writing file to CSV format. To write to an Excel file, convert your data to a table
and use writetable.
Error in payroll>pushbutton4_Callback (line 528)
xlswrite(filename,data)
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in payroll (line 17)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)payroll('pushbutton4_Callback',hObject,eventdata,guidata(hObject))
Caused by:
Error using dlmwrite (line 104)
The input cell array cannot be converted to a matrix.
Error while evaluating UIControl Callback.
>>

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by