How can I use the numeric value of a Physic variable
Show older comments
Im working in a code that works with physycal variables and I need to operate with a physical variable and this function:
7.537326681679638e-004 * exp (0.921 * u) * u
where "u" represents the physican variable.
The physical variables are defined like this Argument 1 = {[1x1 double], 'V'}", so there is a numeric value and its unit, in this example, V ( volts)
When i try to run it, the program complains as follows:
"No matching signature found for exp. exp takes one dimensionless argument.
Argument 1 = {[1x1 double], 'V'}"
I cant find a way to use just the numeric value of the argument. Is there any way to do it?
3 Comments
TADA
on 29 Apr 2019
Try this:
uv = {1};
7.537326681679638e-004 * exp (0.921 * uv) * uv
manel cugota
on 29 Apr 2019
Jan
on 29 Apr 2019
"It says ..." and "when i try to run it" is not useful. Please post the rlevant part of the code and a copy of the complete error message.
There are no "physical variables" in programming languages and you cannot expect the standard operators of Matlab to handle your cell arrays as you expect it.
Accepted Answer
More Answers (0)
Categories
Find more on Physical Units in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!