Answered
Error in ==> sym.sym>sym.double at 936 ; I want plot
try Eg=0.5:0.05:1.3; V=arrayfun(@(x)0:.05:x-.05,Eg,'un',0); Pin = 1.4458e+026 ; a = arrayfun(@(x1)quad(@(x)x.^2./...

14 years ago | 0

| accepted

Answered
Integral and arrays
|f = @(x)....| - any your <http://www.mathworks.com/help/techdoc/matlab_prog/f4-70115.html#f4-70730 anonymous function>, try: ...

14 years ago | 0

Answered
comparing the values
eg: |imageCells| - cell array contains 8 images (double array) t = {'descend','ascend'} imageCells = arrayfun(@(i1)sort...

14 years ago | 0

Answered
Another odd/even dilemma
t = 1:20 % "your time" % "a" - array (vector(1x20)) of position % "1" - position for odd time % "2" - position for ev...

14 years ago | 0

Answered
Matrix Sub Matrix Error
width=length(m(1,:)); g=zeros(width); for a=1:width for b=1:width e=a+1; f=b+1; ...

14 years ago | 1

| accepted

Answered
generation of vector using for loop
try this is: files = dir('*.tif'); num_files = numel(files);%length also used images = arrayfun(@(k)imread(files(k).n...

14 years ago | 0

Answered
display words in a matrix
out = reshape(sort(cellstr(datestr(datenum([zeros(12,1) (1:12).' ones(12,1)]),'mmm'))),2,[]); please read about functions: ...

14 years ago | 0

| accepted

Answered
how to calculate magnitude and phase angle of a complex number
z = -7+13i M = abs(z) %magnitude Ph = angle(z) %phase angle Ph2 = atan2(imag(z),real(z)) %phase angle

14 years ago | 11

| accepted

Answered
How to solve matrix as a function
m = reshape(cosd(Theta),1,1,[]) mq = m.^2; nq = 1 - mq; n = sqrt(nq); mn = 2*m.*n; T = [mq, nq, mn; nq,mq,-mn; ...

14 years ago | 0

Answered
Time intervals in a array
s = datevec('27/01/2012 16:30:00','dd/mm/yyyy HH:MM:SS'); k = int16(diff(datenum(['16:30:00';'22:00:00']))*24*3600); out...

14 years ago | 0

| accepted

Answered
split matrix
A = randi(1800,801,3);% A - Let your matrix. A1 = A(1:end-1,:); % for this is case - size of A - [801x3] outDouble3d...

14 years ago | 0

| accepted

Answered
performing without randperm function
A=imread('dock.jpg'); A=rgb2gray(A); A=imresize(A,[256 256]) A=double(A) n = numel(A); A1_10 = repmat(A,[1,1,10...

14 years ago | 0

| accepted

Answered
error using 256x256matrix
A=[2 4 5 3 6 8 9 2 5 1 3 4 ]; n = numel(A); m = 10; t = 4; A_1_10 = A(:,:,ones(m,1)); k = nchoo...

14 years ago | 0

Answered
edit-generating a matrix value
<http://www.mathworks.com/matlabcentral/answers/27680-making-the-value-as-0 duplicate question> or <http://www.mathworks.c...

14 years ago | 0

Answered
Find Command and Empty matrix: 1-by-0 Error
a = find(abs(x_matrix - 0.3) < 100*eps) please read <http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar....

14 years ago | 0

Answered
Compare elements of two matrices
all(C(:))

14 years ago | 0

| accepted

Answered
number of white pixels
_*eg*_ BW = rand(15)<.5+0; L = bwlabel(BW, 8); out = [(1:max(L(:))).',accumarray(nonzeros(L),ones(nnz(L),1))]

14 years ago | 1

Answered
Generating a matrix
out = ... bsxfun(@plus,reshape(bsxfun(@plus,.31:.1:.51,[0;.01]),1,[]),[0; .02*(1:99)']); *OR* out = reshape(permu...

14 years ago | 0

| accepted

Answered
Finding neighbours of an element in a matrix
please try this is <http://www.mathworks.com/help/toolbox/images/ref/bwdist.html function> OR <http://www.mathworks.com/m...

14 years ago | 0

Answered
How to use three- line loop with disp to find derivative
syms x real f = x.*(2*x+1).^(1/2) df = arrayfun(@(i1)diff(f,x,i1),1:5,'un',0); out = cat(1,df{:}) *:)* out = ...

14 years ago | 0

| accepted

Answered
how to apply mask on image
<http://www.mathworks.com/help/toolbox/images/ref/blockproc.html try this function> <http://www.mathworks.com/help/techdoc/re...

14 years ago | 1

Answered
How to find a peak in data?
<http://www.mathworks.com/help/toolbox/signal/ref/findpeaks.html try this is> *or* data = randi(179,30,1);% eg your data...

14 years ago | 0

| accepted

Answered
nested loops/vectorization/array indexing
l = (1:Nm).' - 1; M = M + 1; S = bsxfun(@times,cos(pi*mod(l,M)*X.'/Lx),... cos(pi*bsxfun(@times...

14 years ago | 0

| accepted

Answered
rearranging the data in separate columns when difference of 10 is found in vectors
|A| - your vector (issorted(A) == 1) n = A; out = []; while ~isempty(n) k = (n - n(1)) <= 10; out = [ou...

14 years ago | 0

Answered
Converting a text file to a Matlab matrix/variable
t = ['oooo o o' 'o o o o'] out = reshape(regexprep(t(:)',{'o',' '},{'1' '0'}),size(t...

14 years ago | 0

| accepted

Answered
How do you label the rows and columns of an array?
[rows,columns,Mvalues] = find(M)

14 years ago | 0

Answered
How to delete coefficient?
>> format short g

14 years ago | 0

Answered
On Cell Array
|C| - your cell array |n| - number of elements in the your cell array out = C(randi(n)) *or* out = C{randperm(n...

14 years ago | 0

| accepted

Answered
edit-replacing a value by another
:0 A = randi(50,100,6); % Your matrix n = size(A,1)/2; n1 = cumprod([(1:n).',2*ones(n,size(A,2))],2)*.1;

14 years ago | 0

| accepted

Answered
repacing a value by another
A =rand(100,6); [i1,j1] = ndgrid( 1:ceil(size(A,1)/2),1:size(A,2)); i1(:,2:end) = i1(:,2:end) - 1; j1(:,1) = j1(:...

14 years ago | 0

| accepted

Load more