Effacer les filtres
Effacer les filtres

How to I pass the char value dynamically

2 vues (au cours des 30 derniers jours)
Praveen Choudhury
Praveen Choudhury le 2 Nov 2015
loc1 = 'D11'
loc2 = 'H11'
range = 'loc1:loc2'
range should be D11:H11 when I do loc1:loc2
How to do that?

Réponse acceptée

Guillaume
Guillaume le 2 Nov 2015
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.

Plus de réponses (0)

Catégories

En savoir plus sur Timing and presenting 2D and 3D stimuli 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