R-Plot a Stored Graphic

조회 수: 4 (최근 30일)
Niklas Reinshagen
Niklas Reinshagen 2020년 5월 25일
답변: Sindhu Karri 2020년 5월 29일
Hello, I've a stored Pie-Chart: P=pie([1 2 3])
When I first use the Function, it shows me the Pie-Chart. And when I close it and type the whole Pie-Command again, it shows me the chart again. But I can't just type "P" and Matlab shows me the chart again. Is there any specific command to do this, or is it not just easy to do?

답변 (1개)

Sindhu Karri
Sindhu Karri 2020년 5월 29일
Hii,
MATLAB workspace variables will be deleted after exiting ,so you will not be able to access variable ‘P’. Moreover ‘P’ is a graphics array, so you can’t get pie chart from variable ‘P’. Instead you can save data for which you want pie chart in a variable (a=[1 2 3]),save it to .mat file using save. After reopening MATLAB you can load .mat file using load. Then use command pie(a),to get pie chart.
You can use below line of code for same:
p=[1 2 3]
save("variables.mat")
After initialising matlab:
load("variables.mat")
pie(p)
Refer to below links:

카테고리

Help CenterFile Exchange에서 Pie Charts에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by