필터 지우기
필터 지우기

How to I pass the char value dynamically

조회 수: 2 (최근 30일)
Praveen Choudhury
Praveen Choudhury 2015년 11월 2일
댓글: Praveen Choudhury 2015년 11월 2일
loc1 = 'D11'
loc2 = 'H11'
range = 'loc1:loc2'
range should be D11:H11 when I do loc1:loc2
How to do that?

채택된 답변

Guillaume
Guillaume 2015년 11월 2일
This looks like Excel type of coordinates, so not sure what this has to do with Matlab.
To get the string 'D11:H11' with your two variables:
range = sprintf('%s:%s', loc1, loc2);
%or
range = [loc1, ':', loc2];
Personally, I prefer the first form.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Timing and presenting 2D and 3D stimuli에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by