help me with implementing simple funtion

조회 수: 2 (최근 30일)
Aydin Ahmadli
Aydin Ahmadli 2018년 11월 13일
답변: Luna 2018년 11월 13일
I was asked to implement function F= CrossVal(’PLearn’,’PRecall’,Par1,’PLearn’,’PRecall’, Par2)
'PLearn', 'PRecall' are strings containing names of the respective functions. So, I have 2 questions:
  1. How the hell can I call function PLearn in another function, if it was called as string?
  2. How the hell can I implement a function containing 2 same strings ? (PLearn and PRecall were mentioned twice as arguments of function)

답변 (1개)

Luna
Luna 2018년 11월 13일
Hello Aydin,
Have a look at this str2func. It converts string into function. If you want to declare your PLearn and PRecall inside the CrosVal function it might work:
when it comes to call the function, I think you can call it with using ‘@’ but I am not sure about the syntax.
As far as I understand, your function gets Plearn PRecall functions outputs as inputs and also gets Par1 and Par2 as inputs. And gives you an F output. What will be your F value?

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by