Figures and its hyperlinks activities through workspaces. And disp(ans).

2 次查看(过去 30 天)
Hello and greetings to all !!!
Check it out:
Through this code it is possible to display "all properties" hyperlink of the figures or structure and their fields, or view them in the open window, that is, for me works. Just don't close the "figures" before or now; do it afer the code. There is also the advantage of hiding the ans through disp (ans). Although this is not recommended, in this code works, however, if you do it in the command window it does not work, for example: x = 2; disp (ans). If there is any suggestion or criticism to improve it, it would be very useful, please.
On the other hand, eventually, one assignin and evalin can be applied to the variables B1, B2, B3, ..., and then, (if i'm not wrong and no problem), in the model explorer, going to the workspace in the hierarchy (with f14), they can be exported to a mat file. But, this is not for an eventual exhibition in which results are needed step by step without leaving empty parts, and in that case, only until the last end, are retaken..., Therefor since the evalueters requirements are strict.
Then, if someone serves and interests you and makes a formality deal with serious effects, also, if code worth it (the code presented below). So, my request is that you explain the concept of "callback", please. I know what it is to call a function, but, if I am not wrong, but it is not the same. If give me a little time, and, simply, carefully and explicitly especifys the concept of "callback", perhaps a simple example, please.
I thank you in advance, and, let's see, what do you think and opinion, constructive criticism or suggestion. PLEASE !!!
Never mind, please, but, if possible and no problem does not bother, better in Spanish.
Thanks anyway.
% Many lines before this activity, that is, others activities above. Maybe plot and savefig.
while true
prompt='Desea ver el o los gráfico(s) resultante(s) (si/yes/no). : '; % Do you wish to see the graph (yes/yes/no) ?
end
lo=input(prompt, 's');
lo=strtrim(lo);
if strcmpi(lo,'si') | strcmpi(lo,'no') | strcmpi(lo,'yes')
clc
break;
elseif strcmpi(lo,'')==1 | strcmpi(lo,'si')==0 || strcmpi(lo,'no')==0 || strcmpi(lo,'yes')==0
clc
display ('La respuesta debe ser si o yes o no.'); % The answer have to be yes or yes or no.
end
end
end
si=1;
yes=2;
no=0;
lo=subs(lo);
if lo==1 | lo==2
for i=aro
%close
if lo==1
fig2=openfig(sprintf('papo%d.fig',i),'reuse');
B.(genvarname(['B' num2str(i)])) = fig2;
assignin('base','B',B);
fprintf('B%d = ',i);
[B.(['B' num2str(i)])];
disp(ans);
disp('Haga click aquí <a href="matlab:dbcont">dbcont</a> o escriba dbcont para continuar el programa.'); % Click here or write dbcont.
fprintf('\n');
openvar('B');
keyboard
G(i)=arrayfun(@getframe,[B.(['B' num2str(i)])],'un',0);
F(i)=cell2mat(G(i));
else % Thi is only for invisible fig, that is, below this 'else'
fig2=openfig(sprintf('papo%d.fig',i),'invisible');
B.(genvarname(['B' num2str(i)])) = fig2;
assignin('base','B',B);
fprintf('B%d = ',i);
[B.(['B' num2str(i)])];
disp(ans);
disp('Haga click aquí <a href="matlab:dbcont">dbcont</a> para continuar el programa.');
fprintf('\n');
openvar('B');
keyboard
G(i)=arrayfun(@getframe,[B.(['B' num2str(i)])],'un',0);
F(i)=cell2mat(G(i));
end
end
%f14 % f14. Remove first " % " if you want to enter in f14,
save_to_base % File Exchange
B
commandwindow
end
% Many lines after this activity, that is, others activities below. Maybe close figures or do a movie.
  2 个评论
Rik
Rik 2019-8-11
You can use the tools explained on this page to make your question more readable. I'll edit your question for you.
Your question is quite confusing. What is your exact question? Do you want to know what a callback function means?
It looks like you are either looking extremely deep inside Matlab function, or you are hacking things together in a very strange way. Did you try finding a Matlab tutorial? There are many in English, but I am sure there are also many in Spanish. Using functions like assignin is usually a bad idea.
Why don't you describe your actual goal? Also, have a read here. It will greatly improve your chances of getting an answer.
César Hernández
César Hernández 2019-8-11
编辑:César Hernández 2019-8-11
Thanks for your comment !!!
My request is or was to explain to me a simple example of the "callback" concept clearly and simply. But in the previous question I put "callback" as a tag and in that link there are several examples of "callback".
It is not too much if you want to help me, please.
Is that my language is Spanish.
Thanks in advance.

请先登录,再进行评论。

采纳的回答

Vimal Rathod
Vimal Rathod 2019-8-14
I assume that you want a simple example on callbacks to use in figures.
Here is a link which can provide you a good understanding on callback functions:

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Desktop 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by