function handle specify in matlabfcn function

1 visualización (últimos 30 días)
llu
llu el 14 de Nov. de 2021
Comentada: llu el 22 de Nov. de 2021
Hi,
Is it possible to specify the function handle in matlabfcn function when using the spreadsheet link in Excel? when i try to do an integration with the syntax"=@matlabfcn("quadgk","@(x) x.^2",M3,M4)" in Excel, it returnd an error, and said the first input argument must be function handle, is there anyone can help me how to specify the function handle in matlabfcn function? Many thanks.

Respuestas (1)

Jan
Jan el 14 de Nov. de 2021
Editada: Jan el 16 de Nov. de 2021
According to the documentation doc matlabfcn :
=matlabfcn("quadgk(@(x) x.^2)", M3, M4)
  7 comentarios
Jan
Jan el 21 de Nov. de 2021
Editada: Jan el 21 de Nov. de 2021
I cannot test it by my own. What about:
matlabfcn("@(a,b) quadgk(@(x) x.^2,a, b)", L3, L4)
llu
llu el 22 de Nov. de 2021
Can't work. Currently, the only methodology that I find is using the user definded function, like below:
function y = ab(a,b)
f= @(x) x.^2;
y= quadgk(f,a,b);
end
then use the syntax " matlabfcn("ab",L3,L4)" in excel

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Functions in Microsoft Excel en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by