Import Graph to Curvefitting
조회 수: 5 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (1개)
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Fit Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!