已回答
Index issue with using a global variables that are vectors in a function
Why are you using global? you can simply write function TH=THETA(y, z,qv,dv); TH=qv(y) + z*((qv(y))^2)/(1 - (dv(y))*z); ...

8 years 前 | 0

| 已接受

已回答
select row and iterate for next rows
A=randi(100,100,4) [n,m]=size(A) for k=1:n % loop each row r=A(k,:) % get the kth row % Do end

8 years 前 | 0

| 已接受

已回答
conversion of hexadecimal timestamps
use hex2dec command a='10' b=hex2dec(a)

8 years 前 | 0

已回答
How to use matrix elements as indices to access elements of another matrix
Values(:,:,1) = [0 0 1 2 2 2 1 1 2 1 0 0 1 1 2 1 2 1 2 2] Values(:,:,2) = [1 0 1 2 2 0 2 1 ...

8 years 前 | 0

| 已接受

已回答
Is it possible to plot a cell array on y axis (imagesc function)
Use Yticklabel instead of ytick set(gca, 'YTicklabel',{'AU1','AU1-2','aa' })

8 years 前 | 0

| 已接受

已回答
how to control a simulink block through mfile?
Use set_param fucntion <http://www.mathworks.com/help/simulink/slref/set_param.html> To update your simulink model use ...

8 years 前 | 0

已回答
Double the resolution of a vector
a=[0 2 5 10 12] b=sort([a a(1:end-1)+diff(a)/2]) You can also use interp1 function a=[0 2 5 10 12] b=interp1(1:...

8 years 前 | 0

| 已接受

已回答
Linestyle does not change
Increase the line width t=0:0.1:10 r1=sin(t) r2=2*cos(t) r3=t plot(t,r2,'--b');hold on plot(t,r3,'-.r','linewidth',3);...

8 years 前 | 0

已回答
How to import timestamp from excel
If your time vector is in the first column for example [a,b,c]=xlsread('d1.xlsx') out=datestr(a(:,1),'HH:MM:SS')

8 years 前 | 1

| 已接受

已回答
How do I write, while using XLSWRITE to capture a column matrix at particular column of excel file.
A=randi(10,10,1) xlswrite('fic1.xlsx',A,'B:B')

8 years 前 | 0

已回答
Fastest way to cycle through a structure for a number
s(1).val = 50 s(2).val = 47 s(3).val = 22 find([s(:).val]==50)

8 years 前 | 0

已回答
How to make character String
str='the quick brown fox jumps over the lazy dog' out=strsplit(str) strsplit was introduced in R2013a If your Matlab ve...

8 years 前 | 1

| 已接受

已回答
xlswrite and xlsread is not working on Matlab R2015b, August 20, 2015, License 326XXXX, 64 bit on HP laptop
Maybe you are trying to create a file in an unauthorized folder like : C:\Program Files\MATLAB\R2016a\bin change your current f...

8 years 前 | 0

已回答
how to convert char to array of string?
name_final = {'PECCalc_tqElFil2_VW_173','PECCtl_bDampCtl_VW_173'} out=regexp(name_final,'.+(?=.{4})','match','once')

8 years 前 | 0

| 已接受

已回答
How to solve linear system equations Ax=b but b is vector of variables
syms r1 r2 r3 b=[r1+r2;r3+3*r3;r1+9*r1] A=randi(3,3) x=A\b

8 years 前 | 1

已回答
How to give name to cell in variables column?
columnname=genvarname(repmat({'col'},1,12),'col') %or columnname={'a','b','c','d'}

8 years 前 | 1

已回答
How to vectorize the following code?
v={'Adana','Adıyaman','Afyon','Ağrı','Amasya'} sehirName = {'Ağrı';'Ağrı';'Ağrı';'Amasya';'Amasya';'Amasya';'Amasya';'Adana'}...

8 years 前 | 0

| 已接受

已回答
How can I extract line numbers of text data?
str=[] fid=fopen('portion.txt') l=fgetl(fid) while ischar(l) str{end+1,1}=l; l=fgetl(fid); end fclose(fid) str...

8 years 前 | 1

| 已接受

已回答
How to edit a particular row of a particular column of .dat file ?
fid=fopen('filename.dat') d=textscan(fid,'%s %f %f %f') fclose(fid) M=cell2mat(d(:,2:4)) %Or [a,b,c,d]=textread...

8 years 前 | 0

已回答
Use Simulink (MATLAB) to simulate the following systems then show and plot the step response of the system. 1. 4
<http://www.mathworks.com/videos/getting-started-with-simulink-69027.html> For your problem look at this link <http://blogs....

8 years 前 | 0

已回答
I want to read number from the file, but there are several sentences in the first 5 lines, just want to read the number from the 6th line to the last line
for k=1:1000 fid=fopen(sprintf('%d.txt',k)) d{k}=textscan(fid,'%f','headerlines',5) fclose(fid) end out=cell2...

8 years 前 | 0

已回答
find function exceeds matrix dimensions?
Depending on what you want, if the two columns should be equal to nan hh1 = hh1(~all(isnan(hh1(:,19:20)),2),:) %or if a...

8 years 前 | 0

| 已接受

已回答
How to connect simulink model and genetic algorithm in matlab?
Use Matlab Function Block <http://www.mathworks.com/help/simulink/slref/matlabfunction.html>

8 years 前 | 1

已回答
How can I display images from image names in a matrix?
[numbers,imagenames]=xlsread('filename.xlsx') for k=1:numel(imagenames) images{k}=imread(imagenames{k}) end

8 years 前 | 0

已回答
create a randomised vector from matrix
A=reshape(1:37*8,37,8) % Example [n,m]=size(A) idx=cell2mat(arrayfun(@(x) randperm(n)', 1:m,'un',0)') idy=zeros(size(idx))...

8 years 前 | 0

已回答
Assign Cell Array to singe variable
This is not recommended. Read this <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3...

8 years 前 | 0

已回答
Associate an array to every element of a matrix
Use cell array. For example M={ [1 2 3] [1 2] [4 5;6 5] 'abc' [ ] }

8 years 前 | 1

已回答
How can I change the name of a variable?
Read this <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F> you will know that it...

8 years 前 | 0

已回答
sum and average of a vector
A=randi(10,30,1) % Example mean(reshape(A,3,[])) If the length of A is not a multiple of 3 A=randi(10,38,1) n=num...

8 years 前 | 0

| 已接受

已回答
How to find a certain content with index in cell array by looping
A={4 [] [] [] 5 6 [] [] 7 8 9 10} B=A' idx=~cellfun(@isempty,B) out=B(idx)

8 years 前 | 1

| 已接受

加载更多