Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to have several inputs for a single parameter for a function

조회 수: 1 (최근 30일)
Abdullahi Geedi
Abdullahi Geedi 2019년 4월 25일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi
I've an issue regarding inputs. Fx. I've created a function which simulates fugacity of a mixture .
The function starts with something like:
function [ fiL,fiV,fL,fV ] = FUGACITY_INMIX_SRKVDW( Pc,Tc,omega,kappa,eta,P,T,x )
Problem is the mixture contains several components with different Pc. How do i put more than a single value for the input space of 'Pc'.

답변 (1개)

Star Strider
Star Strider 2019년 4월 25일
In your function, use ‘Pc’ as a vector. A vector of quantities can have as many as you want. Then, in your function, determine the number of elements in it, for example:
Pcn = numel(Pc);
and use that to determine loop index values or other information.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by