Is 'newplot' the reason why 'image' and 'plot' are no longer working on my computer?

9 ビュー (過去 30 日間)
Hi,
I have been using the plot and image command for years, and did so two weeks ago with no problem. Last week something strange occurred. Can someone help me to get image working again? FYI: I have restarted Matlab, tried Matalb2013a, as well as, Matlab2014b, and restarted my computer. I have tried this with image files (that I displayed in the past) and simple integers.
I thought the problem had to do with image, but now plot is not working. Both have the newplot command in common.
Here are two simple examples and the errors they generate:
>>image([2 45 100 200; 200 300 1 45])
Error using findall Too many input arguments.
Error in clo (line 49) kids_to_delete = setdiff(findall(obj,'serializable','on','-depth',1),obj,'legacy');
Error in cla (line 29) clo(ax, extra{:});
Error in newplot>ObserveAxesNextPlot (line 125) cla(ax, 'reset',hsave);
Error in newplot (line 74) ax = ObserveAxesNextPlot(ax, hsave);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
plot([1 2], [3 4]) Error using findall Too many input arguments.
Error in clo (line 49) kids_to_delete = setdiff(findall(obj,'serializable','on','-depth',1),obj,'legacy');
Error in cla (line 29) clo(ax, extra{:});
Error in newplot>ObserveAxesNextPlot (line 125) cla(ax, 'reset',hsave);
Error in newplot (line 74) ax = ObserveAxesNextPlot(ax, hsave);

採用された回答

Star Strider
Star Strider 2015 年 2 月 16 日
There are two possibilities to try:
The first is to be sure you’re not overshadowing the image function. Run this in the Command Window:
which image -all
It should return only something similar to:
built-in (C:\Program Files\MATLAB\R2014b\toolbox\matlab\specgraph\image)
Otherwise, in case the MATLAB path became strange, this may help:
restoredefaultpath
savepath % <— MAY NOT BE NECESSARY
rehash toolboxcache
If those don’t work, Contact Support!
  4 件のコメント
Coraline
Coraline 2015 年 2 月 16 日
Hey,
Your suggestion to restore the default path worked!
Mega thanks!
Star Strider
Star Strider 2015 年 2 月 16 日
My pleasure!
I apologise for my delay in replying. Life intrudes...

サインインしてコメントする。

その他の回答 (3 件)

Youssef  Khmou
Youssef Khmou 2015 年 2 月 16 日
In previous version of software it works correctly, if you have used the name 'image' for your constructed function, rename it. Anyway image function is built in function, so we can not see the code.
  1 件のコメント
Coraline
Coraline 2015 年 2 月 16 日
It has always worked in all of my versions of the software. I think the problem may actually be in newplot.
Please see my edited question.

サインインしてコメントする。


Sean de Wolski
Sean de Wolski 2015 年 2 月 16 日
which -all findall
My guess is you overloaded findall with your own function. The output for the above should look like this:
C:\Program Files\MATLAB\R2014b\toolbox\matlab\graphics\findall.p
  2 件のコメント
Coraline
Coraline 2015 年 2 月 16 日
This is what I got /Applications/MATLAB_R2013a.app/toolbox/matlab/graphics/findall.p
Coraline
Coraline 2015 年 2 月 16 日
I think the problem may actually be in newplot.
Please see my edited question.

サインインしてコメントする。


Abdallah Ghazi Faisal Zaid Alkilani
Abdallah Ghazi Faisal Zaid Alkilani 2020 年 3 月 28 日
編集済み: Abdallah Ghazi Faisal Zaid Alkilani 2020 年 3 月 28 日
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)
and it has worked *fingers crossed*.
I hope this helps.

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by