답변 있음
How to create an indexing program that removes numbers between values
ii = find(test2 < 0,1 , 'first')-1; out = [test2(1:ii-1),test2(test2 == test2(ii))]; after last Andrew's comment t ...

대략 9년 전 | 0

답변 있음
how to generate a random number between the range -50 to 50?
a = 10*(rand()-.5) or integer namber a = randi([-50,50])

대략 9년 전 | 0

답변 있음
Repeating elements in a matrix.
A=zeros(3,4); n = size(A,1); A([1:n+1:end,n+1:n+1:end]) = 1 or t = true(3,4); out = tril(t,1) & triu(t);

대략 9년 전 | 1

| 수락됨

답변 있음
create and fill new matrices every nth row of an initial matrix
Let A - your matrix [3060 x 2] out = permute(reshape(A',size(A,2),170,[]),[2 1 3]);

대략 9년 전 | 0

답변 있음
Combining matrix of different dimension.
m1 = [2 2; 0 0]; m2 =[1 1;0 0]; m3=[2 2 2 2 ;3 3 3 3]; C = {m1,m2,m3}; [r,c] = cellfun(@size,C); m = ma...

대략 9년 전 | 2

| 수락됨

답변 있음
How can I write a table from a matrix?
c = num2cell(pr,1); TTout = timetable(datetime(year1,month1,day1),c{:});

대략 9년 전 | 0

답변 있음
How to get title for excelwrite code depend on data of specific column
Let |data| - your data [1431770 x 4]. a = accumarray(data(:,4),1); out = mat2cell(data,a,size(data,2)); for ii = 1:nu...

대략 9년 전 | 0

| 수락됨

답변 있음
How to read in various columns from a text file and output a new txt file with specific data.
T = readtable('sampledata.txt'); TT = table2timetable(T); TTout = TT(:,[4,6]); TTout.Properties.DimensionNames={'Time...

대략 9년 전 | 0

답변 있음
Subscripted assignment dimension mismatch for table variable
t1 = struct('f1','001','f2',2,'f3',3,'f4',4); t2 = cell2table(cell(4,4),'VariableNames',{'f1','f2','f3','f4'}); t2{1,:} ...

대략 9년 전 | 0

답변 있음
Separate duplicates into different numeric matrices
a = [100 1 0.44 100 2 0.12 100 3 1.86 100 1 0.02 100 2 3.29 100 3 0.39 101 1 0.32 101 2 0.29 101 3 0.5...

대략 9년 전 | 0

답변 있음
simulate hourly data from monthly data
Let TT - your data as <http://se.mathworks.com/help/matlab/ref/timetable.html?searchHighlight=timetable&s_tid=doc_srchtitle |tim...

대략 9년 전 | 0

답변 있음
is there a way to implement a for loop in which matrix multiplication is exist?
ii = 1:r; t = 2:n; k = r*(n-1); Y = reshape(reshape(W(:,ii,t),[],k)'*reshape(x(:,ii,t-1),[],k),r,[]);

대략 9년 전 | 0

답변 있음
I want count iteration in a binary matrix as follows.
out = diff(sort([strfind([0,I],[0,1]),strfind([I,0],[1,0]) + 1])); or out = accumarray(cumsum([1,diff(I)~=0])',1)';

대략 9년 전 | 0

답변 있음
replacing the for loops
cxy = permute(repmat(SortDate(q,4:6),1,1,L),[1 3 2]); here |cxy| your arrays |c,x| and |y| as |cxy = cat(3,c,x,y)|

대략 9년 전 | 1

| 수락됨

답변 있음
Really easy one how to quickly repeat columns in an array
a = 1:10; out = a(:)*ones(1,10);

대략 9년 전 | 1

문제를 풀었습니다


Insert Special character in character cell array.
input={'a','b','c'} then ans={'a','*','b','*','c'}

대략 9년 전

답변 있음
how to concatenate vetcors
t1 = ismember(k,v); v(ismember(v,k)) = temp; out = [v,k(~t1)];

대략 9년 전 | 0

답변 있음
Can I index into a timeseries using time?
use your data as <http://se.mathworks.com/help/matlab/ref/timetable.html |timetable|> and use <http://se.mathworks.com/help/matl...

대략 9년 전 | 0

답변 있음
Convert Cell to Struct
structtt = cat(1,tracks_array{:});

대략 9년 전 | 3

| 수락됨

답변 있음
Integral of two function
Please read about function <http://se.mathworks.com/help/matlab/ref/integral.html?searchHighlight=integral&s_tid=doc_srchtitle |...

대략 9년 전 | 0

답변 있음
given an mxn matrix, we've have to find the sum of elements for which the sum of their row no.(x) and column no.(y) is greater than m(total no. of rows)
out = sum(A(flip(triu(true(size(A)))))) or for MATLAB >= R2016b [m,n] = size(A); out = sum(A((1:m)' + (1:n) > m)) ...

대략 9년 전 | 1

| 수락됨

답변 있음
how to calculate conditional probability
[a,~,c] = unique(values,'stable'); d = reshape(c,[],2); dm = min(d(:,2)); ny = accumarray(d(:,2) - dm + 1,1); [a1,...

대략 9년 전 | 3

| 수락됨

답변 있음
How to extract multiple matches into separate rows?
T = readtable('test sheet.csv'); T_variance = varfun(@var,T(:,[1,end]),'G','Groups'); for plotted For_plot = ac...

대략 9년 전 | 1

답변 있음
How can I count the number of zeros in a matrix until the value is non-zero?
B = sum(cumsum(A,2) == 0,2);

대략 9년 전 | 2

답변 있음
How to get 15-min average values from 10 min average values?
TT = timetable(minutes(10*(1:10)'),randi([-20,100],30,1),'V',{'var'}); % Let TT - your data TT_15min = retime(TT,minute...

대략 9년 전 | 1

답변 있음
How can I output multiple function outputs in a single vector (accessing all elements of an N-D array in a function)
output = cell(numel(siz),1); [output{:}] = ind2sub(siz,IND);

대략 9년 전 | 0

| 수락됨

답변 있음
On re-arranging a matrix
omtx = 10*(1:6)' + (1:6); % your original matrix m = size(omtx,1); y = tril(true(m)); a = omtx.'; fmtx = y + 0; ...

대략 9년 전 | 1

| 수락됨

답변 있음
how to find the equivalent resistance of two resistors in parallel and series
r1=1200; r2=1000; parallel = @(r1,r2)1/sum(1./[r1,r2]); % or: parallel = @(r1,r2)prod([r1,r2])/sum([r1,r2]); rt=paral...

대략 9년 전 | 0

답변 있음
how to find parallel of resistors
Z_parallel = 1/sum(1./z); % here z - parallel resistors Z_series = sum(z); % here z - series resistors

대략 9년 전 | 0

답변 있음
if elseif else in Table
ii = discretize(T.Time,[-inf,5,15,25,inf]) V = [5,15,25,30]'; T.TimeNew = V(ii);

대략 9년 전 | 0

| 수락됨

더 보기