답변 있음
How to select columns based on a known repeated pattern.
data = raw(:,bsxfun(@plus,29:32,22*(0:floor((size(raw,2)-32)/22))'));

12년 초과 전 | 0

| 수락됨

답변 있음
How to calculate average of certain value in a matrix?
Av = mean(A([1:2:end;2:2:end])); or Av = sum(A([1:2:end;2:2:end]))/2; *ADD* n = 3; Av = accumarray(floor((n:n...

12년 초과 전 | 0

| 수락됨

답변 있음
How to set all elements in a 2D Matrix between two indices to "1" in each row
cumsum(A,2)>0 & fliplr(cumsum(A(:,end:-1:1),2))>0

12년 초과 전 | 3

답변 있음
Where is the mistake ?
use |./| instead |/|: u=10:1:100000; d=4225; e=1.917./(4*pi*(10.^-7)*u)+1.326*10.^7;

12년 초과 전 | 0

답변 있음
How to solve a first and second order coupled differential equations
Try this is code with use Symbolic Toolbox: syms a b c d e x(t) y(t) z = dsolve(diff(x) + x/a == a*y,diff(y,2) + 1/b*dif...

12년 초과 전 | 0

답변 있음
Avoid loops to make code run faster
data = [0 0 0 0 0 0 735690 26.90 27 0 0 0 0 0 0 735781 28.10 28.20 0 0 0 0 0 0]; out = data;...

12년 초과 전 | 0

| 수락됨

답변 있음
how can I draw this loop ?
plot([a,-a],[b,-b]);

12년 초과 전 | 0

답변 있음
inquiry about a command
a=-5:2:50; n=1:100; X = -sum((-1).^n./n)*a; % EDIT

12년 초과 전 | 0

답변 있음
Constuctiing special array (like binary)
rem(floor((0:pow2(n)-1)'*pow2(1-n:0)),2)

12년 초과 전 | 1

답변 있음
Ascending Sort in a cell of file names
b ={'p1-cimg.txt' 'p11-cimg.txt' 'p12-cimg.txt' 'p13-cimg.txt' 'p14-cimg.txt' 'p3-cimg.txt'...

12년 초과 전 | 0

답변 있음
How can i create a multivariable function from matrix data?
Totalcost= A(:)'*p(:);

12년 초과 전 | 0

답변 있음
how to allocate elements of a vector into different rows in a matrix, preserving the column order?
Z = zeros(4,2); Z(sub2ind(size(Z),P,1:numel(P))) = X;

12년 초과 전 | 0

| 수락됨

답변 있음
Converting a the result vector from logical indexing into a matrix possible or unnescesary?
T = A(A(:,2) == 3,:);

12년 초과 전 | 1

| 수락됨

답변 있음
How to use str2func to replace eval command?
t = linspace(0.001,2,1000); x_e = 't^3'; y_e = 'exp(t)'; z_e = 'cos(10*t)'; funs = arrayfun(@matlabFunction,sy...

12년 초과 전 | 0

답변 있음
Replicating values a certain number of times
Jos (10584)'s idea: k = 1959; n = 4; x = floor((0:(k+1)*n-1)/n);

12년 초과 전 | 1

답변 있음
How to calculate average in a large matrix?
xy = [2 4 4 6 7 1 2 3 4 5 1 2 3 4 5 1 2 4 5 6 2 5 6 8 9 4 7 8 4 9 ...

12년 초과 전 | 1

| 수락됨

답변 있음
Sorting data points so x are in ascending order.
[x1,ii]= sort(x); y1 = y(ii);

12년 초과 전 | 2

답변 있음
How to find first nonzero element/first '1' per row and set other elements to zero without loops in 3D Matrix
s = size(A); out = zeros(s); i2 = s(2) - sum(cumsum(A,2)>0,2) + 1; [ii,kk] = ndgrid(1:s(1),1:s(3)) idx = [ii(:),i2...

12년 초과 전 | 1

| 수락됨

답변 있음
Symbolic matrix diagonalization problem
Err = simplify(d1-D); all(Err(:) == 0)

12년 초과 전 | 0

| 수락됨

답변 있음
how to access elements from matrix
M = cat(3,a,b,c); ii = 1; jj = 2; out = squeeze(M(ii,jj,:));

12년 초과 전 | 0

답변 있음
create a matrix with existing matrix
One way: newsize2 = 3600; [i0,j0] = ndgrid(1:size(A,1),1:size(A,2)); F = griddedInterpolant(i0,j0); [io,jo] = ndgr...

12년 초과 전 | 1

문제를 풀었습니다


Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

12년 초과 전

답변 있음
How to split a number into 10 different numbers?
a = 50390; b = rand(10,1); b = b/sum(b)*a; out=round(b); out(1) = out(1) - (a-sum(out)); and with using Roger Staf...

12년 초과 전 | 1

답변 있음
How to use the index of a matrix in another one?
iend = cumsum(counter); ifs = iend - counter + 1; idx = zeros(iend(end),1); idx(ifs) = 1; idx = cumsum(idx); [i...

12년 초과 전 | 0

답변 있음
Find out the real part of symbolic expression by using MuPad
Re(y0*(y2+I*y0)/(y0+I*y2)) assuming ([y0,y2],Type::Real) or assume([y0,y2],Type::Real); Re(y0*(y2+I*y0)/(y0+I*y...

12년 초과 전 | 0

| 수락됨

문제를 풀었습니다


Swap two numbers
Example Input: a = 10 b = 20 Output a = 20 b = 10

12년 초과 전

문제를 풀었습니다


Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

12년 초과 전

문제를 풀었습니다


Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

12년 초과 전

문제를 풀었습니다


Wrap a vector, but insert NaN's at the wrap-positions.
When you plot a line that wraps, and do not want the sawtooth shape to show up in the plot, you can either draw all separate lin...

12년 초과 전

문제를 풀었습니다


Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

12년 초과 전

더 보기