Answered
How to convert convert a cell{x,y,...}(V,W) into an array(x,y,...,V,W) with an "automatic process" ?
v=2; w=9; tic n=[size(a) v w]; out1=zeros(n); idx1= repmat({':'},1,ndims(a)); for k=1:v for p=1:w idx= [idx1 ...

13 years ago | 1

Answered
Question about sets and cell array
B{1}(1)=[] If you want to remove all zeros in B{1} B{1}(B{1}==0)=[]

13 years ago | 0

| accepted

Answered
Changing data type without changing bits
var1 = int16(652) a=dec2bin(var1,16) a=a(9:end) out=bin2dec(a)

13 years ago | 0

Answered
Could someone check my work?
if 0 > t & t > 8 is always false

13 years ago | 0

| accepted

Answered
Using an m file in anohter m file
A = [15 3 22; 3 8 5; 14 3 82]; B =[1;5;6]; C = [12 18 5 ] D=[A(:,3) B C(1:3)'] Look at <http://www.mathworks.com/help/...

13 years ago | 0

Answered
Finding the maxima/minima of a function.
You can use findpeaks function

13 years ago | 0

| accepted

Answered
How to convert convert a cell{x,y,...}(V,W) into an array(x,y,...,V,W) with an "automatic process" ?
v=2; w=9; n=[size(a) v w]; out=zeros(n); for k=1:v for p=1:w out(:,:,:,k,p)=cellfun(@(x) x(k,p),a); end...

13 years ago | 0

Answered
Help me get a numeric answer please. I have a symbolic answer for x but just want a number. Conversion with double(x) doesn't work???
a=evalin(symengine,... ['numeric::solve(tan(pi*x/180)'... '+tan(((4000-2672)/2672)*pi*x/180)==626/(1300))'])...

13 years ago | 0

| accepted

Answered
SimElectronics help on where to get it
Simelectronics is a toolbox <http://www.mathworks.com/products/simelectronics/>

13 years ago | 0

Answered
How do I create a term - frequency matrix that runs fast
A = {'dog','cat','mouse'}; D = {'dog','cat','cat'; 'cat','mouse','mouse'}; out=zeros(size(D)); for k=1:numel(A) idx=is...

13 years ago | 0

| accepted

Answered
Padcat with multiple matrices
You can use A=[2 3;4 5]; m=4; out=repmat(A,m,1) %or out=repmat(A,1,m)

13 years ago | 0

Answered
Pulling subset from a 2D matrix
a=[1 1 1 ; 2 2 2 ; 3 3 3] b==a<3 mySubset=a.*b

13 years ago | 0

| accepted

Answered
How to take the z transform of a delayed unit step using ztrans?
%heavyside(0)=1/2 not 1 It's like you have |step(k)+0.5*kronecker(k)| then it's z transform will be z/(z-1)+1/2

13 years ago | 0

Answered
Simple question on using and specifying equations
syms x y = 3*x + 5 out1=subs(y,10) % The result is a sym class out2=double(out1) % the result is double

13 years ago | 0

| accepted

Answered
Magnitude of a vector
m=sqrt(x^2+y^2+z^2)

13 years ago | 2

Answered
Solving Linear Systems with sparse matrix
<http://www.mathworks.com/help/matlab/math/sparse-matrix-operations.html#f6-9169>

13 years ago | 0

Answered
create a line between two points on an already made plot
add hold on plot([0 85.8024],[0.8736 1.2157],'r')

13 years ago | 2

| accepted

Answered
how to match patterns begining with : and endsing with space
regexp(str,'\d+(\s)?\d','match')

13 years ago | 0

Answered
How to find out the index of the list for each number
*EDIT* Schedule=[1,4,3,1]; m=numel(Schedule); n=max(Schedule); out1=zeros(n,m); out1(sub2ind([n m],Schedule',(1:m)'))...

13 years ago | 0

| accepted

Answered
How to find out the index of the list for each number
period1=[1,0,0,1] idx=find(period1==1) %or period1=[1,0,0,1;0,0,0,0;0,0,1,0;0,1,0,0] out=cell2mat(arrayfun(@(x) find...

13 years ago | 0

Answered
Simulink State-Space model with Sparse Matrices
Simulink software converts a matrix containing zeros to a sparse matrix for efficient multiplication.

13 years ago | 0

Answered
How to connect the external signal to Switch controlled by external physical signal
Look at <http://www.mathworks.com/matlabcentral/answers/86059-how-to-connect-simulink-block-and-simpowersystem-block>

13 years ago | 0

Answered
Dynamic Legends plot option (error: two legend lines for each plot)
Look at this example x=0:0.1:10; y1=sin(x); plot(x,y1) hl=legend('leg1') hold all y2=cos(x) plot(x,y2) leg=[get(hl,...

13 years ago | 0

| accepted

Answered
new girl needs a little help with fprintf and loopies
Your for loop should be inside {fopen fclose} fopen %your for loop fclose

13 years ago | 0

Answered
How can I generate a single random number?
rand % random number between 0 and 1 %or randi(100) % integer random number between 1 and 100

13 years ago | 1

| accepted

Answered
Making a code runs faster
You can start by pre-allocating <http://www.mathworks.com/help/matlab/matlab_prog/techniques-for-improving-performance.html> ...

13 years ago | 0

Answered
where can i find the voltage controlled switch in maltlab simulink
In simelectronics toolbox <http://www.mathworks.com/help/physmod/elec/ref/voltagecontrolledswitch.html>

13 years ago | 0

Answered
isempty error cell contents referencefrom a non-cell array object
Maybe raw_data_012 is not a cell array? Type raw_data_012 What do you get?

13 years ago | 0

| accepted

Answered
How can i arrange the coordinates from a matrix ?
X=[0 0 0 1 0;0 0 0 1 0;0 1 1 1 0;0 1 0 0 0;0 1 0 0 0]; [n,m]=size(X); a=reshape(1:n*m,n,m); a(:,2:2:end)=flipud(a(:,2:2:end...

13 years ago | 0

Answered
save matlab output to excel
If M is your matrix M=[1 9 7;2 2.5 3;3 45 23] xlswrite('yourfile.xls',M)

13 years ago | 0

Load more