How to Plot data in excel sheet using MATLAB ?

OUTPUT I WANT
I want this chart using matlab...!!
xlswritefig function not allowed ..!!

3 件のコメント

Rik
Rik 2021 年 11 月 15 日
Instead of flagging your question as unclear, why don't you improve it by editing it?
Divyesh pandav
Divyesh pandav 2021 年 11 月 16 日
@Rik hope now, all clear.!!
Rik
Rik 2021 年 11 月 16 日
Flags are used to attract the attention of site administrators. Please use comments to clarify what you mean and how that differs from the suggested solution.

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

 採用された回答

Walter Roberson
Walter Roberson 2021 年 11 月 16 日

0 投票

To create the bar chart inside the excel file, you will need to use the ActiveX interface to talk to Excel on MS Windows (will not work on Mac or Linux)
There are two approaches.
One approach is to create a graph at the MATLAB level, and convert the graph to an image, and insert that image into the excel file. See https://www.mathworks.com/help/matlab/matlab_external/example-reading-excel-spreadsheet-data.html#bqfirb9 for an example.
The other approach is to use the ActiveX interface to send VBA plotting commands to Excel. See an example at https://www.mathworks.com/matlabcentral/answers/463285-plots-in-excel-sheets-using-matlab#answer_376014

1 件のコメント

Divyesh pandav
Divyesh pandav 2021 年 11 月 16 日
@Walter Roberson sir , can u write for single variable
Exmple data in Image..!!

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

その他の回答 (1 件)

KSSV
KSSV 2021 年 11 月 15 日

1 投票

Your excel file has no much data. You can read the data from excel file into workspace using readtable.
T = readtable('test.xlsx') ;
You can use the table to plot what you want.,

8 件のコメント

Divyesh pandav
Divyesh pandav 2021 年 11 月 16 日
Divyesh pandav
Divyesh pandav 2021 年 11 月 16 日
I want this chart using matlab.!!
KSSV
KSSV 2021 年 11 月 16 日
編集済み: KSSV 2021 年 11 月 16 日
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/799574/test.xlsx') ;
Warning: Column headers from the file were modified to make them valid MATLAB identifiers before creating variable names for the table. The original column headers are saved in the VariableDescriptions property.
Set 'VariableNamingRule' to 'preserve' to use the original column headers as table variable names.
A = table2array(T(2:end,2:end)) ;
l = T.(1) ;
bar(A)
xticklabels(l)
Divyesh pandav
Divyesh pandav 2021 年 11 月 16 日
@KSSV sir, now this chart plot in my excel sheet how can i do it..!!
KSSV
KSSV 2021 年 11 月 16 日
Solution is already given.
Divyesh pandav
Divyesh pandav 2021 年 11 月 16 日
@KSSV sir, this matlab plot (bar(A)) , i want in My Excel Sheet..!!
Rik
Rik 2021 年 11 月 16 日
So you want to use Matlab to create a bar chart in your excel file? Why not do that in excel directly?
Divyesh pandav
Divyesh pandav 2021 年 11 月 16 日
@Rik yes sir, its take too much time , for long data that's why i need,

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

Community Treasure Hunt

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

Start Hunting!

Translated by