Matlab engine through C++ - Avoid the opening of the graph
1 回表示 (過去 30 日間)
古いコメントを表示
Hi everyone,
I am using matlabe engine through my C++ code. my code is very simple and each time I run it it opens the graph from matlab, before saving it in a folder. Is there a way of telling matlab to not open the graph when it creates it ?
here is my matlab code
h(:,1)=one;
h(:,2)=two;
[y,x]=hist(h);
%NumBins = 10;
bar(x,y, 'group');
title('Area comparison');
xlabel('Area'); % x-axis label
ylabel('Frequency'); % y-axis label
%may do it as two variables passed through C++
legend('XZ','YZ');
saveas(gcf,mypath);
one, two, and mypath are variables given through C++. cheers, Flo
0 件のコメント
採用された回答
James Tursa
2016 年 5 月 5 日
編集済み: James Tursa
2016 年 5 月 5 日
Prior to calling the hist function, create the figure with the 'Visible' property set to 'Off'. E.g.,
f = figure('Visible','Off');
[y,x] = hist(h);
:
etc
If you subsequently want to see the plot, you can do this:
set(f,'Visible','On');
If you never want to see the plot with this code, then you don't need to save the gcf in the f variable.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!