Answered
MATLAB Matrice Function Question help please?
out = abs(bsxfun(@minus,0:4,(0:4)'))

14 years ago | 0

Answered
finding nearest vlaue
A=[1 2 8 7 9 6 10 14 89] a = zeros(3); out = cell(numel(A),2); for i1 = 1: numel(A)...

14 years ago | 0

Answered
change binary string to decimal
try use this is code: GGG =[ 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 ...

14 years ago | 0

| accepted

Answered
Nonlinear differential equations
Pleace read about <http://www.mathworks.com/help/techdoc/ref/ode23.html solve initial value problems for ordinary differential e...

14 years ago | 4

| accepted

Answered
error using function
variant bstr - binary string function dec = bin2decimal(bstr,M) % bstr = string array!!! M = 6; k = bstr - '0';...

14 years ago | 0

Answered
matching strings in a matrix of m x n and then sorting
K = {1 'www.facebook.com' 'user1' 2 'www.gmail.com' 'user2' 3 ...

14 years ago | 0

| accepted

Answered
XLSwrite to write in a different column in each iteration
*EDITED* on Ahmad comment [~,isrd] = sort(double(rr2(:,2:end))); N = cellstr(rr2(:,1)); xlswrite('rr2.xlsx',N(isrd));...

14 years ago | 0

Answered
Interpolating NaN-s
inn = ~isnan(x); i1 = (1:numel(x)).'; pp = interp1(i1(inn),x(inn),'linear','pp') out = fnval(pp,linspace(i1(1),i1(end...

14 years ago | 5

| accepted

Answered
how to read the ms excel numeric data?
try use z = xlsread('E:\ac.xls'))

14 years ago | 0

Answered
vectorizing four nested for loops
variant R = bsxfun(@plus,a,reshape(a,1,1,n,n))

14 years ago | 2

Answered
How to find consecutive numbers
i1 = 1; C{i1}=a(i1); for j1 = 2:numel(a) t = a(j1)-a(j1-1); if t == 1 C{i1} = [C{i1} a(j1)]; ...

14 years ago | 3

Answered
matrix extract without using for loop
start=[1 3 4]; rowSize=2; out = cell2mat(arrayfun(@(i1)A(i1,start(i1)+(0:rowSize)),(1:size(A,1))','un',0)); OR s...

14 years ago | 0

| accepted

Answered
corrcoef - vectors of different lengths
try use function |interp1| eg data1 = 1 + (20-1).*rand(1,12); data2 = 1 + (20-1).*rand(1,24); d2 = interp1(1:numel...

14 years ago | 1

| accepted

Answered
d Sav/ d WI
sw = reshape([0.47 0.254 0.532 0.539 0.588 1.071 0.662 3.349 0.736 12.72 0.772 26.54 ],2,[]) dsw = diff(sw,1,2) Fo = dsw...

14 years ago | 0

Answered
How do you use the else if commands to alter variables in matrices?
n = 5 M = full(spdiags(ones(n,1)*[3 8 5],[-1 0 1],n,n)) out = M(:,end:-1:1) OR M = zeros(n) M([n-1:n-1:n^2-2*...

14 years ago | 0

Answered
Symbolic Integration: Explicit integral could not be found
try numeric solution eg sigma = .2; mu = 2; t = @(w)(w-6.5).*(w*sigma).^(-1).*(1/sqrt(2*pi)*exp(-(log(w)-mu).^2/si...

14 years ago | 0

| accepted

Answered
for loop
eg syms x M = [x^4,2,x^(4/5)-4*x;x,2*x^3,log(x);exp(3*x),x,3*x]; solution dM = diff(M,x); idx = fliplr(fullfa...

14 years ago | 1

Answered
find similarities between cells
Year1 = {{'Y2007','Y2008','Y2009','Y2010','Y2011'}; {'Y2004','Y2005','Y2006','Y2007','Y2008','Y2009'};{'Y2007','Y2008','Y2009'...

14 years ago | 1

| accepted

Answered
Nesting the value of variable in fsolve?
use V = @(E)exp(E(1)) + E (2); F = @(E)[E (1) +34 * E (2), E (1) + (2 + V(E) * 8) * E (2)] OR F = @(E)[E(1) +34 ...

14 years ago | 1

| accepted

Answered
Simple data extration from notepad
try this is code fid = fopen('yourtxtfile.txt'); C = textscan(fid,'%s %s %f %f %f %f %f %f','Delimiter',',','CollectOutp...

14 years ago | 0

Answered
Applying custom function to each cell in matrix (or cell array)?
A = rand(3); out = A < .475 OR use cell array Ac = num2cell(A); out = cellfun(@(x)x < .425,Ac,'un',0)

14 years ago | 2

Answered
Removing elements from Cell array
eg A = arrayfun(@(x)randi(randi(6),randi(6),1),(1:100)','un',0); i1 = [12, 30,45,90 ]; solution A(i1) = [];

14 years ago | 0

| accepted

Answered
Sorting
l = [1 2 3 4 5 6 7 8 9 10 1.3 -2.3 4.245 12.3 -4.5 9.43 8.34 -5.3 3.54 6.4]; solution [i1,i1] = sort(l(2,:),'desc...

14 years ago | 0

Answered
matrix for Ternary ABC points
so? a = (0:.05:100)'; [x y] = ndgrid(a); out = [y(:) x(:) flipud(x(:))];

14 years ago | 0

| accepted

Answered
How to read a structure array
pg Mstruct = struct('a','gfjgfjf','b',[4 5 6],'c',{{7 8 9}}) nfield = fieldnames(Mstruct) for j1 = 1:numel(nfield),di...

14 years ago | 0

Answered
Matrix dimensions must agree.
cp=1005; r=287; d=1.2; v=300; tx=284; px=98; to=298; py=(100:200).'; a1=((d*v*r).^2)./(2*cp...

14 years ago | 0

Answered
remove equal items without loop
x = setdiff(x,y) y = setdiff(y,x)

14 years ago | 3

Answered
concatenate a cell array(string) and a double array numeric
out = [x;num2cell(y)];

14 years ago | 1

Answered
how to create plot of inverse data?
so? pg set(gca,'XDir','reverse')

14 years ago | 1

| accepted

Answered
need help optimizing this code...
Variant ws = w.*s; dTot = bsxfun(@times,ws,triu(ones(numel(w),1)*ws.',1)); dTot = sum(dTot(:))*2;

14 years ago | 0

| accepted

Load more