I would like to transfer a figure into excel. the 1st figure will be produced in the middle of the overall code.

1 次查看(过去 30 天)
subplot(2,2,1)
Angle=linspace(100-90,250-90);
%the angle needed for this is (-ve direcion)
plot(Breakeven,Angle)
xlabel('Breakeven')
ylabel('Angle(Deg)')
RadianAngle=spline(Breakeven,cangle,0);
DegreeAngle=RadianAngle/(180*pi);
col_header={'Breakeven','Angle'};
xlswrite('data.xlsx',[Breakeven(:),Angle(:),],'Sheet1','A2' );
xlswrite('data.xlsx',col_header,'Sheet1','A1');
xlswritefig(gcf,'Results.xlxs','Sheet1','D2'); ->i would like the figure to be exported to the file as well.
Choicedeflection=input('Deflection of choice (mm) : ')
Angleofchoice=spline(Breakeven,Angle,Choicedeflection)
col_header={'Choice of Deflection','Angle recommended'};
xlswrite('data.xlsx',[Choicedeflection(:),Angleofchoice(:),],'Sheet2','A2' );
xlswrite('data.xlsx',col_header,'Sheet2','A1');

回答(1 个)

Vijay
Vijay 2022-11-16
You can use the function xlswritefigfrom the link below.
narginsupport in scripts have been removed since 2016 you can use narginchk instead.
Please refer to the documentation below for 'narginchk'
Hope that helps!

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by