Effacer les filtres
Effacer les filtres

save the value in side the function file

1 vue (au cours des 30 derniers jours)
Laura
Laura le 23 Juil 2015
Commenté : Laura le 24 Juil 2015
I have 3 m-files let say:
function [f]=fun(g)
Myy=20*x^2; % Assume we know x matrix
f=Myy;
the 2nd file is
function [c]=bisect(fun,a,b)
Ma=fun(a);
Mb=fun(b)
c=(a+b)/2;
Third file:
a= 1; b=2;
c=bisect(@fun,a,b)
If I run the third file, how do I save (store) value of f every time, a,b is changed. Thanks

Réponses (2)

Azzi Abdelmalek
Azzi Abdelmalek le 23 Juil 2015
k=0;
a= 1;
b=2;
k=k+1
c{k}=bisect(@fun,a,b)
  1 commentaire
Laura
Laura le 24 Juil 2015
I tried that but it seems to be not working.

Connectez-vous pour commenter.


Azzi Abdelmalek
Azzi Abdelmalek le 23 Juil 2015
k=0;
a= 1;
b=2;
k=k+1
c{k}=bisect(@fun,a,b)

Catégories

En savoir plus sur Files and Folders dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by