답변 있음
How to genneral a repeat array
For users |MATLAB R2014b| and older out = reshape(repmat(a(:)',3,1),[],1)'; or out = kron(a,ones(1,3));

거의 10년 전 | 0

답변 있음
How do you make a matrix of months??
de = [727563 727564 727565 727566 727569 727570 727571 727572 727626 727627 727628 ...

거의 10년 전 | 0

답변 있음
Matlab delete's value's from array
k = [1 20 3 0 NaN 19 2 1.1 NaN 20 1 0.9 NaN 19 2 0.4 0 18 0 0.3 1 19 1 ...

거의 10년 전 | 0

답변 있음
How to automatically get values from nx1 struct
b = [a.Centroid];

거의 10년 전 | 1

| 수락됨

답변 있음
How to make a polynomial with negative power?
z = roots([.9, -2.2, 2.2]) % here your polynomial 0.9*x^2 - 2.2*x + 2.2

거의 10년 전 | 0

답변 있음
Is there a way to change a vector range by condition?
x=(-10:10)'; z = x(5:15); z(z>0) = 100; x(5:15) = z; or x=(-10:10)'; b = false(size(x)); b(5:15...

거의 10년 전 | 1

| 수락됨

답변 있음
How to create a random matrix 8x8 with 2 decimals
x = round(a,2);

거의 10년 전 | 0

답변 있음
Can someone help me with my code? Topic: integration
out = trapz(V); or out = sum(V) - sum(V([1,end]))/2; or S = cumtrapz(V); or S = [0,cumsum(sum([V(1:en...

거의 10년 전 | 0

답변 있음
Trying to make a "snake" matrix?
N=5; M=9; T = reshape(1:N*M,N,[]); T(:,2:2:end) = T(end:-1:1,2:2:end); or T = reshape(1:N*M,M,[])'; T(2:2:...

거의 10년 전 | 0

답변 있음
How would the simpliest way to do this be?
A = {CityToCityRoadData.startAddress}; B = {CityToCityRoadData.endAddress}; C = [A(:);B(:)]; a = unique(C); [lo1,i...

거의 10년 전 | 0

답변 있음
Averaging the 3D-array
B = mat2cell(A,[2,2],[2,2],[2,2]); out = zeros(size(B)); for ii = 1:numel(out) [a,~,c] = unique(B{ii}(:)); jj = ...

거의 10년 전 | 0

답변 있음
I need a program to check prime numbers
out = n((n(:) == 2 | rem(n(:),2)) ... & any(rem(n(:)./([2,3:2:sqrt(max(n))]),1) ~= 0,2)); use ...

거의 10년 전 | 2

| 수락됨

답변 있음
Given a matrix A = [2 5 7; 4 1 8], write a for loop that will replace all the even numbers with 0.
A(rem(A,2)==0)=0; or with loop for ii = 1:numel(A) if rem(A(ii),2) == 0 A(ii) == 0; end ...

거의 10년 전 | 0

답변 있음
How to get the total count of non zero&non NaN elements by column
a =[1 0 nan 0 nan 2 0 1 0 nan 4 6 3 0 nan] out = sum(~isnan(a) & a ~= 0);

거의 10년 전 | 1

| 수락됨

답변 있음
How to make this complicated array
x=5; y=8; n = 1:(x+y-2); a = zeros(x,y); a([1:x,2*x:x:x*y-x]) = n; out = a + rot90((a + n(end)).*(a > 0),2)...

거의 10년 전 | 0

답변 있음
Leaping loop with constant rows for each identity
A - your array (n x 1) out = conv2(A,ones(12,1)/12,'valid');

거의 10년 전 | 0

| 수락됨

답변 있음
For Loop and final output matrix
Variant: function [CrU,AgrCarbonSimu,MN,MN1,MSA1, MSA2, MSA3]... = CarbonProject(X...

거의 10년 전 | 0

답변 있음
how to count number of repeating's in data series.
A=[22 24 24 36 36 36 48 48 48 48 24 33 22 22]; V = A(:); [~,~,c] = unique(V); t = diff([0;c])~= 0; ix = cumsum...

거의 10년 전 | 2

답변 있음
How to update a value in different raw after performing validity check at one raw?
file(2:end,3) = cellfun(@(x)sprintf('%d',numel(x)),file(2:end,2),'un',0)

거의 10년 전 | 0

답변 있음
Copy certain number from one matrix to another
out = A(:,[1,2,2]); s = regionprops(bwlabel(A(:,2)-1),'PixelIdxList'); ii = {s.PixelIdxList}; jj = cellfun(@(ii)sort(...

거의 10년 전 | 0

문제를 풀었습니다


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

거의 10년 전

답변 있음
For Loop-Specific Dates
dte = datenum(2015,1,(1:sum(yeardays(2002:2015)))'); [~,~,dv] = datevec(dte); t = dv == 1; ii = cumsum([t(2:end);0]);...

거의 10년 전 | 1

문제를 풀었습니다


03 - Matrix Variables 4
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3d.png>> A 3x4 NaN (Not a Number) matrix (Hint: use ...

거의 10년 전

문제를 풀었습니다


03 - Matrix Variables 3
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3c.png>> A 10x10 matrix where the numbers from 1 to 100 ...

거의 10년 전

답변 있음
Explicitly Multiplication of Matrices using For Loops
s1 = size(A); s2 = size(B,2); out=zeros(s1(1),s2); for ii = 1:s1(1) for jj = 1:s2 p=0; for k = 1:s1(2)...

거의 10년 전 | 3

답변 있음
how to create n*n upper triangular matrix with conditions? (image attached)
n = 4; [ii,jj] = ndgrid(1:n); out = (ii == jj) - (ii < jj); or n = 4; out = eye(n) - triu(ones(n),1);

거의 10년 전 | 5

| 수락됨

답변 있음
Is there a Change in Conforming matrix operations?
Yes. Please read <http://se.mathworks.com/help/matlab/matlab_prog/compatible-array-sizes-for-basic-operations.html about it>.

거의 10년 전 | 1

답변 있음
How to extract vertices from a matrix.
A = [... 4 5 6 10 11 12 22 23 24 36 37 38] B = reshape([A.'...

거의 10년 전 | 0

답변 있음
How to convert char into double?
with str2double out = str2double(regexp(val,'\d*','match'))

거의 10년 전 | 4

더 보기