combining string and numerical values
7 views (last 30 days)
Show older comments
Within my conditional analysis of a program I'm working on that basically evaluates partial derivatives to give characteristics of a function, I'm trying to combine a string 'a numerical example is' with a chosen number from an array (example(k)). I've tried a few different methods and I believe I need to utilize num2str but when I try to use it, I get back the error "Input to num2str must be numeric." which doesn't make sense because my value is in fact a number?
Just for trouble shooting purpose I tried int2string and was able to get a number but obviously I need the full number, not just an integer.
for k = 1:numel(B)
if (A(k))>0
if(B(k))<0
disp(['f(x,y) has a saddlepoint at' num2str(x_crit(k)) ])
end
end
end
If it helps these are the values I'm trying to call into the string. Thanks in advance for the help!
x_crit =
0
-13/10
13/10
0
0
-13/20
13/20
-13/20
13/20
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Characters and Strings 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!