I'm new to matlab and am getting the following error
Not enough input arguments.
Error in epithelialTransportFunc (line 20)
G = IC(1);
I'm setting the functions as the following:
% create temporary variables for cell concentrations to make it easier
% to read code
G = IC(1);
Na = IC(2);
K = IC(3);
Cl = IC(4);
The input fuction is the following
function [Cout] = epithelialTransportFunc(t, IC, cs, sglT, NaK, NaCl, ...
glut, perm, cc, nT, mPot, F, R, T)

답변 (4개)

Adam Danz
Adam Danz 2020년 2월 5일

0 개 추천

My guess is that you have a function named IC with two or more required inputs. But you're treating IC as variable so when you index IC(1) you get the error.
To confirm this, run
which IC -all
If this isn't the problem, provide the entire copy-pasted error message.
Martin Pieters
Martin Pieters 2020년 2월 5일

0 개 추천

When I run IC -all I get the following error
>> IC -all
Unrecognized function or variable 'IC'.
Also how do I model the file from the GUI and run the GUI?
Im running Matlab R2019b version
MOP

댓글 수: 1

Adam Danz
Adam Danz 2020년 2월 5일
편집: Adam Danz 2020년 2월 5일
Sharing error messages is extremely helpful but we need the entire copy-pasted error message; all of it.
Also, this isn't what I suggested you do. Look again.

댓글을 달려면 로그인하십시오.

Star Strider
Star Strider 2020년 2월 5일

0 개 추천

You did not pass ‘IC’ (and likely others) as an argument.
Check to be certain you are calling the function correctly in your script. You must call it with all the input arguments, and those arguments must be present in your workspace. You cannot run it by clicking on the green ‘Run’ arrow in the Editor.
Martin Pieters
Martin Pieters 2020년 2월 5일

0 개 추천

Attched is the error message
>> epithelialTransportFunc
Not enough input arguments.
Error in epithelialTransportFunc (line 20)
G = IC(1);
I can also share the code if that would help.
MOP

댓글 수: 2

No need to share the code, at least not right now since that’s not where the problem is.
Be absolutely certain that all the argumetns are present in your workspace, and then call the function in your script as:
Cout = epithelialTransportFunc(t, IC, cs, sglT, NaK, NaCl, glut, perm, cc, nT, mPot, F, R, T)
Running it (without a semicolon at the end of the line) should print ‘Cout’ to your Command Window.
Adam Danz
Adam Danz 2020년 2월 5일
편집: Adam Danz 2020년 2월 5일
The error happens at this line
G = IC(1);
which indicates IC may be a function with 2 or more required inputs (as my answer explains).
Once again, please run this line of code which you havne't done yet.
which IC -all

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

질문:

2020년 2월 5일

편집:

2020년 2월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by