Answered
problem with the symbolic calculation
|I translate variable to the 'sin(...)'| , what doesthat mean? If you want double(S1), just write: sin(Q1rad)

13 years ago | 0

| accepted

Answered
How to create variable names from csv column names?
This a very bad idea,just let your data in one variable, in your case the variable *Array*. <http://matlab.wikia.com/wiki/FA...

13 years ago | 0

| accepted

Answered
Convert videofile to .mat
store frame 1 in A(:,:,:,1) store frame 2 in A(:,:,:,2) and so on then save filename A

13 years ago | 0

Answered
Resample a matrix with a defined interval
You can use interp1 function to interpolate x=A(:,1); y=A(:,2); xi=x(1):-0.05:x(end); yi=interp1(x,y,xi); new_A=[xi',yi...

13 years ago | 0

| accepted

Answered
Adding information to a cell array without using a loop?
[a,b,c]=unique(Array(:,1)); C=accumarray(c,Array(:,2), size(a), @(x) {x}); celldisp(C) %You can add C1=cell(max(...

13 years ago | 0

Answered
Fast computation of diagonal elements
This will reduce the time S=A'*B; d1=arrayfun(@(x) S(x,:)*A(:,x),1:n);

13 years ago | 0

Answered
Reading the required variables for a function
fid = fopen('file.m'); line='' while isempty(line) line=fgetl(fid) end fclose(fid); v=regexp(line,'(?<=\().+(?=\))',...

13 years ago | 0

Answered
trying to create a simple plot. Get error 'Vectors must be the same length'
t = [0:0.1:4] x = exp(-(4-sqrt(3))*t)+exp(-(4+sqrt(3))*t) v = gradient(x)./0.1 plot3(x,v,t); %or t = [0:0.1:4] x =...

13 years ago | 0

Answered
How can i group each column of a matrix after i split a matrix into columns.
mat=rand(x,y) for k=1:size(mat,2) c=mat(:,k) % your column k % Do what you want end

13 years ago | 0

Answered
how do i generate a 1X4 matrix with until the sum of the matrix =100
The probability to fit your conditions is very small, you can run your code all the year, it's not obvious to get the result.

13 years ago | 0

Answered
Search a text in dat file
fid = fopen('filename.dat'); res={}; while ~feof(fid) & res{end+1} =fgetl(fid); end fclose(fid); s=regexp(res,yourt...

13 years ago | 0

| accepted

Answered
On what basis should i choose a model configuration parameters for a simulink block
Read this <http://www.mathworks.com/help/simulink/gui/solver-pane.html>

13 years ago | 0

| accepted

Answered
How I make a pushbutton visible using another pushbutton in a GUI?
You can use the properties 'enable' or 'visible' set(handles.pushbutton1,'enable','off') %or set(handles.pushbutto...

13 years ago | 3

| accepted

Answered
Error using arrayfun : Non scalar in Uniform output
Add |'uniformoutput',false| or |'un',0| C = arrayfun(@ (x) (((a/length(Z))*(1/(2*pi))).*((abs(fftshift(fft(Z,1024))).^...

13 years ago | 2

Answered
whats de difference between simscape electrical elements to simpowersystem electrical elements ????
Most of all element in Simscape electrical are found in Simpowersystems, they do the same thing, but are different blocks. Depen...

13 years ago | 0

| accepted

Answered
how to multiply two sinewaves of different amplitude and frequency in MATLAB/simulink
What is the problem if amplitudes an frequencies are different? You can use a simple <http://www.mathworks.com/help/simulink/slr...

13 years ago | 1

Answered
si=2*(round(rand(1,sbit))-1/2);
a=rand% b=rand(a) % the result is 0 or 1 %If b=1 2*(1-1/2)=1 %If b=0 2*(0-1/2)=-1

13 years ago | 0

| accepted

Answered
Remove repeated row in a matrix (specially zero's repeated row)
*EDIT* a = [1 4 6 0 0 0 6 7 3 0 0 0 3 1 2 0...

13 years ago | 0

Answered
How to obtain a cell of one symbolic matrix?
A = sym('a%d%d', [2 2]) UA=triu(A) P=sym('p%d%d', [2 2]) UP=triu(P); Q=UP*UA; Q(2,2)

13 years ago | 0

Answered
How to read text files in MATLAB
fid = fopen('file.txt'); res={}; while ~feof(fid) res{end+1} =fgetl(fid); end fclose(fid); out1=cellfun(@(x) x(1:2),...

13 years ago | 1

| accepted

Answered
element multiplication- question on multiplying row elements
x(:,1:end-1).*x(:,2:end)

13 years ago | 1

| accepted

Answered
3D plane in MATLAB
X=reshape(x,17,3)' Y=reshape(y,17,3)' Z=reshape(z,17,3)' mesh(X,Y,Z) %or surf(X,Y,Z)

13 years ago | 1

| accepted

Answered
check the condition and assign discrete values
x=rand(1,100) [idx,idx]=histc(x,[0.25 0.5 0.75 1]) for k=1:4 groupe{k}=x(idx==k-1) end

13 years ago | 1

| accepted

Answered
How can I remove a word from an array?
xA=[0 4 2 1]; wA=struct('name',{'person1' 'person2' 'person3' 'person4'},'num',num2cell(xA)); peopleA={wA.name}; numA=[wA....

13 years ago | 0

Answered
How to expand exponential of symbolic expression
Why are you expecting |exp(2*t)*exp(3i*t)| ? |2*t and 3*i*t| are the same degree Try this syms t q=exp((*t+3i*t^2) ...

13 years ago | 0

Answered
I need to make MUSIC on matlab
Look at these links <http://users.rowan.edu/~shreek/networks1/music.html> <http://www.seventhstring.com/resources/notefreq...

13 years ago | 0

Answered
Find the mean of a specific set of values in matrix/vector
z=[ 0 0 0 2 3 4 0 0 0 0 0 6 7 8 0 0 0 13 18 22]; idx=[0 logical(z) 0]; ii1=strfind(idx,[0,1]); ii2=strfind(idx,[1,0])-1; f...

13 years ago | 0

| accepted

Answered
Choosing Specific Elements from An Array
B=[A(1,3) A(2,2:4) A(3,2:5) A(4,2:4) A(5,3)]

13 years ago | 2

Answered
how to add white noise to signal
The power noise depends on the effect of your noise on your signal. For the seed, choose whatever you want, but for one seed you...

13 years ago | 1

Load more