Beantwortet
How to sort by time
T = readtable('20170916.txt','CollectOutput',1); T.Var1 = strcat(T{:,1}(:,1),{' '},T{:,1}(:,2)); T. t = datetime('201...

mehr als 8 Jahre vor | 0

Beantwortet
How to plot y(n) over the range of 0<n<50. the equation given is y(n) = 1.97y(n-1) - y(n-2)
out = filter(1,[1,-1.97,1],[0,1,zeros(1,49)]); plot(0:50,out);

mehr als 8 Jahre vor | 1

Beantwortet
function of matricies and array
To start plese use function <https://www.mathworks.com/help/matlab/ref/sub2ind.html?s_tid=doc_ta |sub2ind|>

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
Identifying x,y coordinate of the peak value value in a 3d array
[m,n,k] = size(output); [max_value_output,ii] = max(reshape(output,[],k)); [xpeak, ypeak] = ind2sub([m,n],ii); out = ...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
Nested loop code to fill a 10x100 matrix
out = (1:100) + (0:100:900)' for older version of MATLAB: out = bsxfun(@plus,1:100,(0:100:900)')

mehr als 8 Jahre vor | 0

Beantwortet
How can I make a circshift function, without using circshift nor shift matlab functions?
a = randi(100,1,12) n = 5; out1 = circshift(a,n) m = numel(a); out2 = a(mod((1:m) - n - 1,m) + 1)

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
comparing two matrix for similar matrix
a = [1 2 3]; b = [1 2 3; 4 5 6; 7 8 9]; i = ismember(b , a, 'rows'); c = b(~i,:)

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
How can I isolate data from a matrix without a for loop?
M = (1:100)'*ones(1,5); pre_indices = [ 40 60 70]; post_indices = [45 65 75]; n = (1:size(M,1))'; l = (n >= pr...

mehr als 8 Jahre vor | 0

Beantwortet
For-loop instantly jump to largest value
x = [750 287.91 1250 345.51 1775 368.55 2300 397.35 ...

mehr als 8 Jahre vor | 1

Beantwortet
How would I extract the first and last nonzero numbers from this array?
a = [0 0 0 0 0 0 0 1 2 2 2 3 0 0 0 0 0 10 2 2 2 2 7 0 0 0 0 0 0 0]; b = a > 0; out = [a(strfind(b,[0 1])+1);a(strfind(b,...

mehr als 8 Jahre vor | 0

Beantwortet
How to optimaze for loop
M = [A,B]; [m,n] = size(M); for ii = 1:m D = M(ii:m,ii:n); [~,k] = max(abs(D(:,1))); D([1,k],:) = D...

mehr als 8 Jahre vor | 0

Beantwortet
I want to obtain number of cases(matrix's length) . By applying same sum in any matrix. (on constraints)
z = 4:12; out = []; for jj = 1:numel(z) k = nchoosek(z,jj); out = [out;num2cell(k(sum(k,2) == 30,:),2)]; ...

mehr als 8 Jahre vor | 0

Beantwortet
how to add two loops
t = 1:k; c = t.^2.*exp(1i*t) + t.*exp(-1i*t);

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
How to place the minimum value of a 3*3 matrix at center of the matrix.?
Let A - your array and we use |Image Processing Toolbox| : out = imerode(A,ones(3)); add [ii,jj] = ndgrid(cei...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
matrix repetition on diagonal
T = [1,0;1,1]; N = 4; [~,d] = spdiags(T); out = full(spdiags(ones(N,numel(d)),d,N,N)); or out = triu(tril...

mehr als 8 Jahre vor | 2

| akzeptiert

Beantwortet
daily data into weekly mean for whole year
Let |A| - your array [m,n,k] = size(A); p = 7; i3 = ceil((1:k)'/p); [ii,jj,kk] = ndgrid(1:m,1:n,i3); out = ...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
How can I re-code numeric variables in a table to strings?
c = {'Male','Female','Old','Young'}; T_out = cell2table(c(cell2mat(Table{:,:})+[0 1])); or for the latest versions of th...

mehr als 8 Jahre vor | 1

Beantwortet
How to move an element from an array?
A(2,3:end) = circshift(A(2,3:end),1)

mehr als 8 Jahre vor | 0

Beantwortet
Expanding Cell Array using repmat with a loop
with loop |for..end| A=[4;5;9;8]; B=[40;10;20;70]; n = cumsum(B); m = n - B + 1; k = size(B,1); C = zeros(n(...

mehr als 8 Jahre vor | 2

Beantwortet
double Conversion to double from struct is not possible.
x1 = load('S_chest.mat'); y1 = load('S_abdomen.mat'); x = x1.x; y = y1.y; A=zeros(size(x)); A(1,1)=x(1); ...

mehr als 8 Jahre vor | 2

Beantwortet
Error using randi Size inputs must be scalar issue.
randi([x_loc1(i)+1,x_loc2(i)-1],1,1) or just randi([x_loc1(i)+1,x_loc2(i)-1])

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
Please help to vectorize this for loop
d = rawdata(6:end); d = reshape(d,5,[])'; out = d(:,1:4); % |R = out(:,1)|; |MF = out(:,2)|; and etc. or just ...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
I have 3942*1 matrix and i want to change this into 73*54 matrix . How can i do this ?
A - matrix [3942 x 1] out = reshape(A,73,[]);

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
Sum of previous data
load('demo.mat'); d = demoS1{:,[4,6]}; [a,ii] = sortrows(d,1); [~,~,c] = unique(a(:,1)); d1 = accumarray(c,a(:,2),...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
How to extract column information of a mix cell array! - Please Help :(
cat(1,C{ismember(C(:,2),'200'),1})

mehr als 8 Jahre vor | 1

Beantwortet
Add time column to matrix with measured values
T_out = timetable(datetime(2017,1,1,13,0,.5*(0:size(M,1)-1)'),M);

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
How to store an array of elements in alternative places of another arrays?
X = 1:10; Q = zeros(1,numel(X)*2-1); Q(1:2:end) = X;

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
Add index matrix to matrix
B = []; ii = 1; x = [9 6 4 11]; add1 = 0; while ii <= 4 add1 = add1(end) + (1:x(ii)); B = [B;{add1}]...

mehr als 8 Jahre vor | 1

| akzeptiert

Mehr laden