How to limit variables in input function?

2 views (last 30 days)
Triveni
Triveni on 23 May 2022
Commented: Triveni on 4 Jun 2022
I have a function
[P_max1(j), ~, ~, ~, ~, ~, ~, ~, ~, ~, ~, ~, ~, ~] = tcfun1(1,P_min11 (j), P_max11(j), T, 1);
It perfectly runs.
When I use
[P_max1(j), ~, ~, ~, ~, ~, ~, ~, ~, ~, ~, ~, ~, ~] = tcfun2(1,P_min11 (j), T, 1);
It perfectly runs.
but when i use
[P_max1(j), ~, ~, ~, ~, ~, ~, ~, ~, ~, ~, ~, ~, ~] = tcfun3(1,P_min11 (j), ~, T, 1);
It gets error.
please help me.

Accepted Answer

Matt J
Matt J on 23 May 2022
It does not make sense to have a tilde as an input argument in a function call. Perhaps you meant,
tcfun3(1,P_min11 (j), T, 1);
  5 Comments
Triveni
Triveni on 4 Jun 2022
Yes, when i sent [] as empty matrix. and add statement within the function
if isempty(idx)
clear idx
end
perfectly work as i want.

Sign in to comment.

More Answers (0)

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!