string data in function

1 view (last 30 days)
Muhammad
Muhammad on 28 May 2021
Edited: Stephen23 on 28 May 2021
i have following functioin
function data(a,b,c)
display(a);
display(b+c);
% here 'a' should be string and rest will be the numbers
end
i have to give values to a,b,c while calling function
so how i can
  1 Comment
Stephen23
Stephen23 on 28 May 2021
Edited: Stephen23 on 28 May 2021

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 28 May 2021
Perhaps something like this —
data('Character Vector', pi, 42)
a = 'Character Vector'
45.1416
data("String Variable", pi, pi)
a = "String Variable"
6.2832
function data(a,b,c)
display(a);
display(b+c);
% here 'a' should be string and rest will be the numbers
end
.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!