Answered
How to pick random number?
randi([2 3]) %or v=[2 3]; v(randi(2))

13 years ago | 3

| accepted

Answered
Generating executable using MATLAB coder?
What about your simulink model? you can't generate an executable from a simulink model with matlab coder

13 years ago | 1

| accepted

Answered
submit a constant to matrices
for k=1:numel(T) T{k}(1)=7 end

13 years ago | 0

Answered
matlab solving equation's method
There is no algorithm for choosing methods. You have to specify what kind of equations you want to solve. You can use different ...

13 years ago | 0

Answered
breaking an if loop
What made you think that this line is not executed?

13 years ago | 0

Answered
switching output based on input
You can use if else statement

13 years ago | 0

Answered
what dots mean in matlab?
Look at structure format Example a.name='victor' a.age=50 a.weight=100

13 years ago | 0

Answered
How to import excel data into .mat format?
Use xlsread to import your Excell data and save to save them in a mat file help xlsread help save

13 years ago | 0

Answered
ztrans.m file missing
which ztrans

13 years ago | 0

| accepted

Answered
Select parts of a string in MATLAB
*EDIT* str =' The DOC for the 10 percent ROI = 332.45 dollars/pass' out=regexp(str,'\d+\.\d+','match')

13 years ago | 1

| accepted

Answered
Can I display 2 legends while using the plotyy function?
legend({Source,'SV_ID'}, 'Location', 'NortheastOutside');

13 years ago | 0

| accepted

Answered
can i make a matrix like this?
n=4; m=4; a=zeros(m,n) a(1:m,1)=1:m a(1,1:n)=1:n for ii=2:m for jj=2:n a(ii,jj)=a(ii,jj-1)*a(ii-1,jj) ...

13 years ago | 0

| accepted

Answered
Plot a 3d line with log scale
set(gca,'xscale','log')

13 years ago | 1

Answered
How to calculate the average value of energy samples obtained from simulation
You do not need a for loop average_residual_energy = mean(energy)

13 years ago | 0

Answered
how can i calculate the angle between a vector and the x axes?
v=[2 3] angle1=angle(v(1)+j*v(2))

13 years ago | 1

| accepted

Answered
Taylor Series as a for loop
What is this 1/(1-x) = ((1/(1-x)) + x.^k/factorial(k));

13 years ago | 0

Answered
write matrices in notepad
dlmwrite('myfile.txt', M', 'newline', 'pc')

13 years ago | 0

Answered
Trying to index rows with specific values in two different columns (order matters) - similar to coordinates.
x={'visual_search' 0 0 'visual_search' 1 0 'visual_search' 0 0 'visual_search' 1 0 'visual_search' 0 1 'visual_search' 1 ...

13 years ago | 0

Answered
Save Matlab Executable WIndows Dos Screen to a Text File
You can use <http://www.mathworks.com/help/matlab/ref/fprintf.html fprintf>

13 years ago | 0

Answered
problem of matrix operations
a=rand(4) % Example n=size(a,1) bsxfun(@minus,repmat((1:n)',1,n),(1:n))

13 years ago | 0

Answered
Solving Matrix Index Problem
c=[0.25 0.1 0.05 0.01] a = [1 0 0 0 ; 0 1 0 0] [max_money,b]=max(sum(bsxfun(@times,c,a),2))

13 years ago | 0

| accepted

Answered
Is it possible to run a .m file continuosly by changing the input parameters?
Matlab function block doesn't allow all matlab function. You can use <http://www.mathworks.com/help/simulink/slref/interpretedma...

13 years ago | 0

| accepted

Answered
Find count of repeated letters
a='I want THAAAAAT APPPPPLE ):):):' s=regexp(a,'\s+','split') out=s(~cellfun(@(x) numel(unique(x))==numel(x),s))

13 years ago | 0

| accepted

Answered
How to plot lnx ?
x= [0 1 2 3 4 5 6 7 8 9] y=log(x) plot(x,y) You should know that log is not defined for x=0

13 years ago | 0

| accepted

Answered
problem with if in a matrix
idxn=sum(g,2)<0 out=g(:,1); out(idxn)=g(idxn,2)

13 years ago | 0

| accepted

Answered
Referencing String in an array?
Use a cell array A = {'Apple', 'Oranges'} A{1} A{2}

13 years ago | 0

Answered
Can I "export", "write" or "save" a table to eg Excel ?
Use xlswrite doc xlswrite oc xlsread

13 years ago | 0

Answered
Text instead of values in tick
set(gca,'xtick',[1 2 3 4],'xticklabel',{'a','b','c','d'})

13 years ago | 0

| accepted

Answered
I cannot create that array in Matlab !
a = [36.48 35.33 35.92 32.28 31.61 38.06 31.86 33.81 30.30 35.27 35.28 36.58 38.81 33.31 33.88 36.34 36.25 30.46 37.37 37.52 3...

13 years ago | 0

Answered
What does this mean "Vectors must be the same lengths"? And who can I fix it?
There is no error in your code, but you can improve it dx=0.002; x=0:dx:2; y=zeros(1,numel(x)) %pre-allocate y(1)=...

13 years ago | 0

Load more