Answered
Limiting the columns of an array.
a=rand(1,402) b=a(1,1:401) %or a(402)=[]

11 years ago | 0

| accepted

Answered
Set Edit Text Empty
set(handles.D_edit,'String',num2str(D*1e3)); set(handles.P_end_edit,'String',num2str(p_(1)));

11 years ago | 0

| accepted

Answered
which matlab toolbox has the function plotconst?
You can search on google by clicking plotconst matlab, you will find it's not a Matlab function

11 years ago | 0

Answered
Question on Reading lines from text file.
fid=fopen('file.txt') for k=1:2 fgetl(fid); end A=zeros(3,6) for k=1:3 A(k,:)=str2num(fgetl(fid)) end fclose(f...

11 years ago | 0

| accepted

Answered
How to give ranking from highest to lowest
Data=[5 6 9 1 5 2] [sd,r]=sort(Data,'descend') sd % sorted data r % the corresponding indices

11 years ago | 2

Answered
How can i populate an array using a for loop?
You have just to pre-allocate before the loop A=zeros(1,n)

11 years ago | 0

Answered
Create equally spaced 2-d array
Your code is correct, you've just mistaken in the line [arrayName(k,:) = linspace(0,k*2*pi, *100*k* )], you should write 100*n i...

11 years ago | 1

Answered
Is there any way to scale histogram elements so instead of simple count get weighted sum within bins?
*Edit* xy=[11.1,12.3,13.2,14.2,15.5,11.8] xyuni=[11,12,13,14,15,16] int=[1,1,1,1,1,0.5] [a,b]=histc(xy,xyuni) c=accuma...

11 years ago | 0

Answered
How to take mean of the first numbers of column in matrix and add to each number in same column?
*Edit* b=bsxfun(@plus,A,mean(A(1:4,:))')

11 years ago | 0

Answered
How to activate or desactivate a simulink block?
set_param('ModelName/BlocName','Commented','off') % or on

11 years ago | 0

Answered
Using ss2tf to obtain two transfer functions
You need A,B and the two matrices C and D, and use [a,b]=ss2tf(A,B,C,D,ni) look at <http://it.mathworks.com/help/matlab/...

11 years ago | 2

| accepted

Answered
How to generate random purmutation of string matrix ?
n = 2 black = zeros(n) white = ones(n) tile = {black white; white black } idx = randperm(4) tile=cell2mat(reshape(tile(id...

11 years ago | 1

| accepted

Answered
How to load multiple files and save each as a matrix?
A = textread(fullFileName); this will erase the previous value of A after each loop, you can use a cell array to save them ...

11 years ago | 1

Answered
Percentage Difference of Values stored in Two Matrices
PDif=100*(temperature-analtemp)./analtemp;

11 years ago | 0

| accepted

Answered
order matrix elements and extract the n th element
A = [1 4 3 9] B = [6 9 3 8] c={A,B} c{1}(1,1)=4 c{2}(2,1)=8

11 years ago | 0

Answered
How to plot all results from a for loop?
k=0; t=73810:196.9:93500 y=zeros(size(t)) % pre-allocate for m0=t k=k+1; y(k)=maxrange(m0) end

11 years ago | 0

| accepted

Answered
Creating a submatrix from a matrix
A= [ 1 2 3 4; 5 6 7 8; 1 3 5 7; 2 4 6 8; ] B=A([1 2 4],[2 3])

11 years ago | 10

| accepted

Answered
question about the sign
Use sign function In your case you can use H(se+1,:)=2*H(se+1,:)

11 years ago | 0

| accepted

Answered
How To Calculate Double Summation In Matlb
A=[1 2 3]; B=[1 2 3;4 5 6;7 8 9]; s=bsxfun(@times,bsxfun(@times, B,A),A'); s=sum(s(:))

11 years ago | 1

| accepted

Answered
Finding element with max value in each row of a matrix
a=[ 1 2 3 4 8 5 2 9 ; 5 6 4 7 9 1 1 2; ] [ii,jj]=sort(a,2,'descend') v=ii(:,1:4) idx=jj(:,1:4)

11 years ago | 0

| accepted

Answered
Obtain cell according to a corresponding value
R=B(cell2mat(A(:,2)))

11 years ago | 0

| accepted

Answered
moving average in eeglab
Look at this example m1=rand(22,2000); m2=rand(22,2000); m3=rand(22,2000); a={m1,m2,m3} b=cat(3,a{:}); out=mean(b,3)

11 years ago | 0

Answered
How to change array element with another array
a = [1 1 1; 1 1 1; 1 1 1] b = [4 4; 4 4] [n,m]=size(b) a(1:n,1:m)=b

11 years ago | 0

| accepted

Answered
how to store all values in one matrix in my code ?
The last for loop of your code is: for r=1:rmax AllCH111(r).x1=AllCH1(:,1); AllCH112(r).y1=AllCH1(:,2); CHbe...

11 years ago | 0

| accepted

Answered
How to save a figure
hgsave(gcf,'filename') use hgload to load it

11 years ago | 0

| accepted

Answered
help with hadamard matrix
H=hadamard(8); a=10 H(2:end,2:end-1)=a*sign(H(2:end,2:end-1)) %or simply H(2:end,2:end-1)=a*H(2:end,2:end-1)

11 years ago | 0

| accepted

Answered
using operators (+,-,*,/) in variables
You can create this function function y=op(a,b,operator) if operator=='+' y=a+b elseif operator=='-' y=a-b els...

11 years ago | 0

Answered
Compute Average Matrix from Cell Array of Matrices
If you fill your missing data with zeros a={rand(122,21), rand(124,21) , rand(117,21)} % Example n=max(cellfun(@(x) size(...

11 years ago | 1

| accepted

Answered
Select elements of Matrix?
P=rand(20) % Example n=18 Q=P(end-n+1:end,end-n+1:end)

11 years ago | 0

Answered
how to multiply simplest way this two vectors ?
xi = [98 99 100 101 102 103]; y = [2 4 6 4 3 1]; x=cell2mat(arrayfun(@(a,b) a*ones(1,b),xi,y,'un',0)) %or you ca...

11 years ago | 0

| accepted

Load more