MATLAB: How to pass the char value dynamically chardatatypesdynamicallypointer loc1 = 'D11' loc2 = 'H11' range = 'loc1:loc2' range should be D11:H11 when I do loc1:loc2 How to do that? Best Answer 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);%orrange = [loc1, ':', loc2];Personally, I prefer the first form. Related SolutionsMATLAB: Char array comparison a=['20070801';'20070802';'20070803']; %some date values b=20070802; %value to compare a(find(str2num(a)<b),:) %date values older than the compared value MATLAB: Generate a discrete time signal from a given continous time signal 如果你要对一个连续信号采样从而得到离散的序列,那么首先你需要指定采样率是多少,或者说每个信号周期内你想采多少个点。假定每个周期内采点数量为N,现在你的信号频率为,那么对应的采样率,那么采样间隔为。因此采样代码如下:N = 10;f0 = 500;fs = N*f0;Ts = 1/fs;k = 0:4095;t = k*Ts;x = sin(2*pi*f0*t);x(1:10)以上代码就能得到你想要的结果了。 Related QuestionDeleting part of chars
Best Answer