Error using plot Undefined function or variable 'newplot'.
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I am using Matlab via Citrix. I am getting the following error while using plot function.
Error using plot in line 30
Undefined function or variable 'newplot'.
% Jake's Method
% close all;
clear all;
N=30;
M=0.5*(N/2-1);
wn(M)=0;
beta(M)=0;
ritemp(M,2001)=0;
rqtemp(M,2001)=0;
rialpha(1,2001)=0;
fm=[1 10 100];
Wm=2*pi*fm;
for i=1:3
for n=1:1:M
for t=0:0.001:2
Wn(n)=Wm(i)*cos(2*pi*n/N);
beta(n)=pi*n/M;
ritemp(n,round(1000*t+1))=2*cos(beta(n))*cos(Wn(n)*t);
rqtemp(n,round(1000*t+1))=2*sin(beta(n))*cos(Wn(n)*t);
rialpha(1,round(1000*t+1))=2*cos(Wm(i)*t)/sqrt(2);
end
end
ri=sum(ritemp)+rialpha;
rq=sum(rqtemp);
r=sqrt(ri.^2+rq.^2);
mean=sum(r)/2001;
% subplot(3,1,i);
% plot(3,1)
time=0:0.001:2;
plot(time,(10*log10(r)-10*log10(mean)));
titlename=['fd= ' int2str(fm(i)) ' Hz'];
title(titlename);
xlabel('time(second)');
ylabel('Envelope(dB)');
pause
end
2 Kommentare
Jianning Dong
am 11 Apr. 2019
I have the same problem here on Linux platform, matlab2019a. Some other functions in the graphics toolbox folder are missing as well.
Antworten (2)
Jianning Dong
am 11 Apr. 2019
Hi Masroor,
I tried to reset the PATH and rehah the toolbox. Now newplot is usable.
MATLAB moves some functions from the root of graphics folder to axis folder.
So if you update matlab from a previous version. You have to reset the path:
restoredefaultpath
rehash path
rehash toolbox
rehash toolboxcache
2 Kommentare
daniel bourdon
am 2 Jun. 2019
I had the same error about variable 'newplot' with Matalb 2019a.
I just typed 'restoredefaultpath' in matlab command window and the plot functions run properly.
David Mellinger
am 17 Jun. 2019
'restoredefaultpath' worked for me as well. I had done the 'rehash' steps from above previously, which did not work, but possibly the combination of the two is needed.
Abdallah Ghazi Faisal Zaid Alkilani
am 28 Mär. 2020
I had a similar issue and I think the culprit is a function called newplot.m.
newplot.m function has subfunctions inside that were not terminated with 'end'.
I added an 'end' statement for each function inside newplot.m:
- function axReturn = newplot(hsave)
- function fig = ObserveFigureNextPlot(fig, hsave)
- function ax = ObserveAxesNextPlot(ax, hsave)
It has worked so far *fingers crossed*.
You can open the file to edit by typing >> open newplot;
I hope this helps.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!