How to assign design variables?

1 view (last 30 days)
Danishtah Quamar
Danishtah Quamar on 2 Mar 2022
Answered: Walter Roberson on 7 Mar 2022
How to assign design variable in matlab coding and call it in mathematical function .
Example:- I have to make a function with variables x and x containing design variable a,b,c,d
And I have to call it in equation in the same function in a way
sigma = 5.04e5./(x(:,3).^2.*x(:,4));
then how to do it.
  2 Comments
Jan
Jan on 2 Mar 2022
What are "design variables a,b,c,d"? Do you mean symbolic variables?
Danishtah Quamar
Danishtah Quamar on 7 Mar 2022
Yes x(1)=a % length
x(2)=b % width
and so on

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 7 Mar 2022
See matlabFunction option 'vars' with the {} approach
matlabFunction(EXPRESSION, 'vars', {[a, b, c, d] })

Community Treasure Hunt

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

Start Hunting!