Filter löschen
Filter löschen

how to pass parameters to a function handle in spmd block

2 Ansichten (letzte 30 Tage)
Samruddhi Pednekar
Samruddhi Pednekar am 15 Apr. 2016
Beantwortet: Ritesh Naik am 18 Apr. 2016
if I have defined a function si = @(x) 1.*(x>=0 & x<=0.5)+... -1.*(x>=0.5 & x<1)+... 0.*(x<0 | x>=1); and f(x)=@ x.*x; now as we know in spmd block you cannot define an anonymous function but you have to use a function handle.now in the spmd block I have to use si(2.^j.*x-k).so how should I pass these parameters j and k to si.(j and k are initialised in spmd block itself)

Antworten (1)

Ritesh Naik
Ritesh Naik am 18 Apr. 2016
You should be able to call using the function handle inside the spmd block by passing the parameters to it. You can find the example in one of your previous MATLAB Answers link:
Are you receiving any errors when you call the anonymous function using the function handle inside the spmd block?
If one of the parameters is anonymous function, you can wrap it in a helper function as suggested in the following link:

Kategorien

Mehr zu Graphics Objects finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by