Answered
Creating variables with a loop
for i=1:5 assignin('base',sprintf('partialmatrix_%d',i), hugematrix(1,whatever*i) end

13 years ago | 1

| accepted

Answered
Matlab Simulink - Load disturbance
You can use a <http://www.mathworks.com/help/simulink/slref/bandlimitedwhitenoise.html Band-Limited White Noise> block

13 years ago | 0

| accepted

Answered
If Regexp matches return 1 otherwise 0 syntax
Maybe you want to use isequal or strcmp

13 years ago | 0

Answered
Resetting a Time vector to zero
newx=x-x(1)

13 years ago | 1

| accepted

Answered
Replace certain values of matrix by one single value
*EDIT* B=A B(B>2.9 & B<3.2)=-1

13 years ago | 2

| accepted

Answered
How do I check that my input doesn't have incorrect characters?
test=0 while test==0 str=input('enter dtring','s') q=regexp(str,'[acgu]') test=numel(q)==numel(str) end

13 years ago | 0

Answered
how to create 2 vectors from a matrix
harmx=harm(1:3:end) harmy=harm(2:2end)

13 years ago | 0

| accepted

Answered
Assign value to an array
The index must be positive integer or logical Your are allowed to use x(1),x(2),... %or x(logical(0)) and x(logi...

13 years ago | 0

| accepted

Answered
Switch/Case and operators
In your case you should use if/elseif x = 222, y = 3; if x==y disp('x and y are equal'); elseif x>y ...

13 years ago | 0

| accepted

Answered
how to plot frequency domain response in simulink ?
You can use <http://www.mathworks.com/help/dsp/ref/spectrumanalyzer.html Spectrum Analyzer> if you have a DSP system toolbox

13 years ago | 1

| accepted

Answered
Remove rows or cols whose elements are all NaN
A(isnan(A))=[]

13 years ago | 2

Answered
How to represent Simulink block diagrams to transfer functions?
If you mean, just by using the name of your model, I'am not sure that is possible, you have to indicate each block in your mode...

13 years ago | 0

Answered
Loading multiple .dat files
data=[]; for k=1:N data=[data dlmread(sprintf('filename_%d_fileend.dat',k))] end

13 years ago | 2

| accepted

Answered
Changing ylim properties of multiple plotyy figures
Try figure(7), ax=gca, set(ax(2),'ylim',[200 700]);

13 years ago | 0

Answered
what's wrong with the code
n=40 for i=1:n for j=1:n if (5<i & i<15 & 8<j & j<12 & j==i) d(i,j)=1; else d(i,j)=0; end ...

13 years ago | 0

Answered
Can you split a vector according to a pre-defined sequence?
M = [1,2,4,2,3,4,5,3,4,2]; P = [2,2,4,2]; id2=cumsum(P); id1=[1 id2(1:end-1)+1]; for k=1:numel(id1) Result(k)=sum(...

13 years ago | 1

| accepted

Answered
How to create a simulink block of transfer function having higher order numerator?
If u(t) is the system input and y(t) is its output: g*y(t)=du(t)+g*u(t) You can use derivative, and sum block to make yo...

13 years ago | 0

Answered
don't plot the first number on the x axis because it's too near to the y axis
set(gca,'xtick',9:0.5:11.5)

13 years ago | 0

| accepted

Answered
How to edit a cell to include a parantheses
fprintf('(%.4f)\n',B)

13 years ago | 1

Answered
how to switch contents of two variables?
temp_date=date1 date1=date2; date2=temp_date;

13 years ago | 4

| accepted

Answered
How can I delete an axes handle from a GUI?
add cla(handles.axes1)

13 years ago | 0

Answered
please tell me what this words "eps" do in this instruction.i searched it from eps doc but i don't understand the application here.
In windows command type eps ans = 2.2204e-016eps eps is a predefined variable

13 years ago | 0

| accepted

Answered
How to convert a list in the variable into a cell array
out=cellstr(reshape('A':'I',[],3)')'

13 years ago | 0

Answered
Changing Simulink Block Values from GUI
If you want to get the real parameters name of your block, type in windows command: get_param('ModelName/AWGN Channel1','di...

13 years ago | 1

| accepted

Answered
plot chart with the respective date on the x axis
Look at this example dates=datenum('01/01/2000'):datenum('01/01/2009') y=sin(0.01*dates) plot(dates,y) d=datevec(dates) ...

13 years ago | 0

| accepted

Answered
Comparator block in simulink
If you want to compare signal1 and signal2 use two block: # sum block to get signal1-signal2 # compare to constant block whe...

13 years ago | 1

Answered
changing the axis of a plot
xlim([0 20]) ylim([0 10])

13 years ago | 0

Answered
How do I count the number of each particular entry in a variable
Look at <http://www.mathworks.com/matlabcentral/answers/68292-counting-frequency-of-strings>

13 years ago | 1

| accepted

Answered
Comparing between Array Elements and result matrix too
c=bsxfun(@eq,b,a)

13 years ago | 1

| accepted

Answered
How to save a figure through each run of a for loop?
for k=1:5 h=figure plot(...) saveas(h,sprintf('FIG%d.png',k)); % will create FIG1, FIG2,... end

13 years ago | 33

| accepted

Load more