MATLAB Answers

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

3 views (last 30 days)
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 Comments

Rik
Rik on 11 Aug 2019
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 on 11 Aug 2019
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.

Sign in to comment.

Accepted Answer

Vimal Rathod
Vimal Rathod on 14 Aug 2019
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 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Products


Release

R2017b