Answered
How to add matrices in a function with varying input arguments
You can use one cell array containing all your matrices

12 years ago | 0

Answered
fitting error, how to fix it
Probably, you have used fit as a variable in your code Try this clear fit x = (0:0.2:5)'; y = 2*exp(-0.2*x) + 0.1*rand...

12 years ago | 0

| accepted

Answered
Quick method to find duplicates in a matrix?
a = [1,2,3,4,5,5,1,6,9]; [ii,jj,kk]=unique(a) out=ii(histc(kk,1:numel(ii))>1)

12 years ago | 4

Answered
Communication between m-files
Use <http://www.mathworks.com/help/matlab/ref/guidata.html guidata>

12 years ago | 0

| accepted

Answered
How to create a vector out of arrays
This is not a good idea. Data1 = [1 2 3 4] Data2 =[5,6,7,8] Just create one variable A=[Data1' Data2'] Look...

12 years ago | 0

Answered
While Loop Problem Displaying NaN
When x is bigger, y becomes infinite, and after you have |Err=(inf-inf)=NaN|. Matlab or another software has its limits.

12 years ago | 0

Answered
Permute a vector by a specific ordering
x=[1 3 2 5 4] y=[.2 .6 .5 .4 .3] [X I]=sort(x) Y=y(I)

12 years ago | 0

| accepted

Answered
Intersection of two sets keeping all intersected values
a=[1 2 3 4 5 6 6 6 7 8 9 10] b=[1 12 113 1 25 3 6 6 ] out=a(ismember(a,b))

12 years ago | 1

| accepted

Answered
adjusting label and title thickness of the plot function
x=[1;2;3;4;5;6;7;8;9;10]; plot(x); xlabel('x coordinates','fontsize',16,'fontweight','bold')

12 years ago | 1

| accepted

Answered
Not have enough information to determine output sizes
In your function you are using the second element of u, remove the mux block, and just connect the switch output to your functio...

12 years ago | 0

Answered
Plot a surface with X Y Z data
When x, y and z are vector, you can't use surf(x,y,z). x,y and z should be matrices of the same size look at <http://www.mathwor...

12 years ago | 0

Answered
Simple Question ( for loop with differnt variables)
Why are you complicating things? for i=1:3 A(i)=i end for i= 1:3 B(i) = A(i) + 1 end Read this <ht...

12 years ago | 0

| accepted

Answered
How to divide x and y axis in graph ?
plot(1./x,1./y)

12 years ago | 1

Answered
how to print two matrices side by side
You can't create such thing, unless you complete a matrix with 0 or whatever you want, you can also use cells test =[ 12 13...

12 years ago | 0

| accepted

Answered
get Data from Cell Arrays
D contains 3 cells, each cell contains an array D{1}(3) % |{1}| to get the first cell, % |(3)| to get the third e...

12 years ago | 0

| accepted

Answered
Filtering a matrix to some small matrices
a = [12,7;12,5;2,7;23,3;23,43;23,12;3,5;76,21;76,31;4,3;4,7;4,9] c1=a(:,1) [ii,jj,kk]=unique(c1,'stable') aa=histc(kk,1:num...

12 years ago | 0

| accepted

Answered
Using .' instead of ' for transpose
|.'| is used to transpose complex numbers, because if for example a is a complex array a=[4+5i 2-i] a' % is the conjug...

12 years ago | 0

| accepted

Answered
Help on Disappearing Popupmenu
Why the for loop? var1 = {'Ex1','Ex2','Ex3'} i=1 set(handles.popupmenu1,'String',var1,'Value',i)

12 years ago | 0

Answered
Correct use of isnan?
You can't remove some values of your matrix. You can remove columns, rows or channels. Obviously, the size of your matrix will b...

12 years ago | 0

| accepted

Answered
Removing matrix rows after the first element of a row becomes too big
[ii,jj]=find(A>10,1); A(ii:end,:)=[]

12 years ago | 0

| accepted

Answered
Convert an [10,1] Array into an [1,10] Array
A=[1;2;3] B=A'

12 years ago | 1

| accepted

Answered
how can solve for ' f ' in 1/sqrt(f) = -2*log(((e/d)/3.7)+(2.51/Re*sqrt(f))) . Re = 1000, d=0.0254, e0.03
Re = 1000, d=0.0254, e=0.03 syms f solve(1/sqrt(f) == -2*log(((e/d)/3.7)+(2.51/Re*sqrt(f))))

12 years ago | 0

Answered
Reading particular values from a *.txt file and saving
fid = fopen('file.txt'); str={}; while ~feof(fid) str{end+1,1}=regexp(fgetl(fid),'(?<= \|).+(?=\|)','match') end fclo...

12 years ago | 0

| accepted

Answered
How to save no variable
In your test assign something to your variable c if strcmp(a,'country') sprintf(b) c='no data' elseif ...

12 years ago | 0

| accepted

Answered
calculate mean af cell
clear out m1=reshape(1:30,10,3); for k=1:3 m=data_matrix(m1(:,k)); f=num2cell(reshape([m{:}],39,[])',1); out{1,k}=a...

12 years ago | 0

| accepted

Answered
Creating arrays in auxiliary functions
If you want your variable k to be seen by all your functions, declare it as global in each function, or pass the variable k as i...

12 years ago | 0

Answered
Change specific simulation time in Simulink
You can use the block <http://www.mathworks.com/help/simulink/examples/if-then-else-blocks.html If-Then-Else Blocks>

12 years ago | 0

Answered
check two matrix if its same display the matched value
a=[1 2 3 4 5 6 7]; b=[3 1 2 4 9 8 4] out=setdiff(b,a,'stable')

12 years ago | 0

Answered
Does zero padding change the actual frequency?
When you add zeros to your signal you get a new different signal, obviously, its fft will be different

12 years ago | 0

Load more