Import Graph to Curvefitting

조회 수: 5 (최근 30일)
ANANTA BIJOY BHADRA
ANANTA BIJOY BHADRA 2022년 2월 23일
답변: Shivang 2023년 9월 29일
I have a B-H curve through simulink simulation. It is plotted through X-Y graph of the simulink. How can I import it to curvefiiting section to get some data?

답변 (1개)

Shivang
Shivang 2023년 9월 29일
Hi Ananta,
I understand you're trying to take a X-Y graph plot in Simulink and then fit a curve to the plot's data.
This can be done by exporting the data captured by the X-Y graph block to a variable/file and then importing that data inside the Curve Fitter app.
The X-Y Graph block includes options to record data. If you double-click on the block, you should see the "Record to Workspace" and "Record to File" options in the Simulation tab.
You can extract the relevant signals from the Simulation Output object and save them to different variables for ease of use. For example, say you select the "Record to Workspace" option and specify the Variable Name as 'data'. You can save the x-axis data to a variable named ‘x’ by writing,
x = out.data{1}.Values.Data
Similarily, the y-axis data can be saved to a variable named ‘y’ by writing,
y = out.data{2}.Values.Data
You can now import these data variables inside the Curve Fitter app, by using the "Select Data" option. Refer to the documentation for more details: https://www.mathworks.com/help/curvefit/curve-fitting.html
Hope this helps.
-Shivang

카테고리

Help CenterFile Exchange에서 Fit Postprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by