Answered
Returning largest and smallest values in the array
function varargout = largest_and_smallest(A) % call largest_and_smallest.m: [L,S,Lidx,Sidx] = largest_and_smallest(A) [c...

15 years ago | 1

Answered
linprog
Removed first variant (17:20 MDT[09:20 EDT]) Hi Nina! Adjustment for the right answer (ADD 13.09.2011 14:20 MDT [06:20EDT]) ...

15 years ago | 0

Answered
How can extract values from array?
x1 = X' x1 = x1(:)' out = x1(x1 == 0 | x1 == 1)

15 years ago | 0

| accepted

Answered
Cleaning Matrix
Data={[] [] 20 [] 25 [] 100}; t = ~cellfun(@isempty,Data) Data(1) = Data(find(t,1,'first')) t = [true;t(2:e...

15 years ago | 1

| accepted

Answered
random symmetric logical matrix
a = triu(rand(5)); out = a + tril(a',-1)>.5 variant 2 a = rand(5) b = a+a' out = b >= mean(b(:))

15 years ago | 1

| accepted

Answered
Undefined function or method 'piecewise' for input arguments of type 'sym'. Error
Variant of the numerical solution - |FourierSeriesForCarl.m| function fs = FourierSeriesForCarl(t,k,L) function x = pie...

15 years ago | 1

| accepted

Answered
How to match and two matrix elements and place it under one matrix...let me explain
C = bsxfun(@times,cell2mat(arrayfun(@(i1)ismember(A,B(i1,:)),(1:size(B,1))','un',0)),A) more variant [m n] = size(B); C ...

15 years ago | 2

| accepted

Answered
combination problem
It's like? out = nchoosek(1:4,2)

15 years ago | 0

| accepted

Answered
Number of Diagonal ones
sum(spdiags(Y,-size(Y,2)+1:1:size(Y,1)-1))

15 years ago | 0

| accepted

Answered
Vectors merging dynamically
TRPfeat = cell2mat(cellfun(@(x)crqa(x,[],[],[],threshold),A(:),'un',0))

15 years ago | 0

Answered
Which columns are linearly independent in a matrix?
[i1 j1] = find(triu(squeeze(all(abs(diff(bsxfun(@rdivide,A,permute(A,[1 3 2]))))<1000*eps)),1)); indclm = find(~ismember(1:s...

15 years ago | 0

Answered
Mapping two matrices
out = [f(:) SPL(:)] with sort out = sortrows([f(:) SPL(:)],1);

15 years ago | 0

Answered
Assign multiple fields to a Struct-Array
for j1 = numel(filelist):-1:1 filelist(j1).names=upper(filelist(j1).names); end variant with |arrayfun| and others ...

15 years ago | 0

Answered
for loop
for i1 = 5:-1:1, x(i1) = i1*2;end for your case x = (1:5)*2 or x = 2:2:10

15 years ago | 1

Answered
Creating new variables and matrix manipulation
*Do not do it.* *Read the <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F FAQ...

15 years ago | 0

| accepted

Answered
Matrix summary - weighted average
variant inital data (A, B) A = [cellstr(datestr(sort(rand(20,1)),'HH:MM:SS')),... mat2cell(ra...

15 years ago | 1

| accepted

Answered
Clearing a structure variable
a.h1 = 800; a.caseid = 'HM'; clear a.h1 a.h1 = [] remove field 'h1' rmfield(a,'h1')

15 years ago | 1

| accepted

Answered
Only show values below a maximum
mtx =[ 0 153 1 631 2 512 3 132 4 523 5 1326] out = mtx(mt...

15 years ago | 1

Answered
Variable
variant use cell array X=rand(20,1) Y=rand(20,1) p = mat2cell([X Y],ones(20,1),2) bad version for j1 = 1:size(X,1) ...

15 years ago | 0

| accepted

Answered
Rearranging and printing matrices
[i1,j1,v] = find(A) out = [j1,i1,v] variant 2 if A have zeros [i1 j1] = ind2sub(size(A),(1:numel(A))') out = [j1 i1 A(...

15 years ago | 1

| accepted

Answered
3 plane to array vectorization
Q = reshape(Atr(1,1,:),1,[]) variant for all matrix Atr n = size(Atr); Qarray = reshape(Atr,n(1)*n(2),[]);

15 years ago | 0

Answered
how to do differentiation?
variant 1 use |Symbolic Math Toolbox| e.g.: your function f(x) = x^3+x^2*2+1 syms x y = x^3+x^2*2+1; df = matlabFunction...

15 years ago | 0

| accepted

Answered
please help fixing the code
variant 1 xtop = linspace(1.1, 1.4, 1000)'; y = arrayfun(@(i1)quad(@(x)sqrt(x-1.1)./(1+exp((x-.86)/.2586)),1.1,i1),xtop)...

15 years ago | 0

| accepted

Answered
knowing how much time does running of a m-file take?
variant 1 (command window) >>tic varoutput = yourfun(varinput) % use your m-file yourfun.m tim = toc % tim - time ...

15 years ago | 1

| accepted

Answered
find a correlation
[v id]= max(triu(corrcoef([X,Y]),1)) Variant last R = triu(corrcoef([X,Y]),1) Rx = R(1:end-1,1:end-1) Rx05 = Rx.*(Rx...

15 years ago | 0

Answered
How to find diagonal projection of an handwritten character image (binary matrix)?
M =[1 2 3 4; 5 6 7 8; 9 0 1 2; 3 4 5 6] LD = sum(spdiags(M(end:-1:1,:),1-size(M,1):size(M,2)-1)) RD = sum(spdiags(M',1-siz...

15 years ago | 3

| accepted

Answered
question for dlmread - why doesn't it work?
on my <http://i53.tinypic.com/19b41l.png laptop>

15 years ago | 0

| accepted

Answered
Connecting lines in 3-d Graph
num = xlsread('LVK 3-D Graph_2.xls'); dt = mat2cell(num,size(num,1),ones(size(num,2),1)); plot3(dt{3:-1:1},'-+r',dt{[5 6 4...

15 years ago | 0

Answered
make result matrix for comparing of (for example) 20 inputs matrix with 20 refrences matrix
%A - matrix input %B - matrix references %AI - names input %BR - names references AI = cellstr(char(64+[1:20])'); BR...

15 years ago | 1

Answered
calling a function n times
function critical_region = yourfun Y=sort(randn(500,10)); Z=zscore(Y); q=size(Y); result = -q(1)-(1:2:q(1)*2)...

15 years ago | 0

Load more