필터 지우기
필터 지우기

string data in function

조회 수: 2 (최근 30일)
Muhammad
Muhammad 2021년 5월 28일
편집: Stephen23 2021년 5월 28일
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
Stephen23
Stephen23 2021년 5월 28일
편집: Stephen23 2021년 5월 28일

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2021년 5월 28일
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
.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by