Effacer les filtres
Effacer les filtres

string data in function

2 vues (au cours des 30 derniers jours)
Muhammad
Muhammad le 28 Mai 2021
Modifié(e) : Stephen23 le 28 Mai 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 commentaire
Stephen23
Stephen23 le 28 Mai 2021
Modifié(e) : Stephen23 le 28 Mai 2021

Connectez-vous pour commenter.

Réponse acceptée

Star Strider
Star Strider le 28 Mai 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
.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by