Answered
breaking a large table into smaller one
ix = diff([0,X,size(x,1)]); % x your table Wanted = mat2cell(x,ix)

7 years ago | 0

| accepted

Answered
Need to Split a column of type 'string' in a Table in to group of 4 characters giving new names to the result.
v=regexp(strrep(T.Data,' ',''),'\w{4}','match');% naming a table with a variable name table is a terrible idea (will hinder the ...

7 years ago | 1

Answered
Assign value in a cell with a "oneliner"
[x{2},x{4}]=deal('x','z')

7 years ago | 1

| accepted

Answered
how to call nested structure and cell array?
[data.timepoints.time]

7 years ago | 0

Answered
ask to change input values and derive a new matrix
I was blind sided in your previous question (because some of your questions were a bit advanced), but you seem to be asking the ...

7 years ago | 0

| accepted

Answered
count numbers greater than zero, and determine among them has the highest number of count
W = sum(Y>0,2) Z = max(W)

7 years ago | 0

| accepted

Answered
How to use a single command to deals with elements?
<https://in.mathworks.com/help/matlab/getting-started-with-matlab.html> - get to know the basics as soon as possible, so you don...

7 years ago | 1

Answered
adding structure in a table
https://in.mathworks.com/help/matlab/ref/table.html#mw_eed92014-a41e-4ffa-a43d-4f1b948c083c - follow the instructions in the lin...

7 years ago | 0

Answered
How to decompose and expand a vector into ones
ones(sum(I)*12,1)

7 years ago | 0

Answered
could anyone help me to solve the issue
ix = [repmat('%.4f ',1,size(a,2)-1),'%.4f\n']; % where a is your matrix fprintf(ix,a.') % or perhaps you need result = sprint...

7 years ago | 0

| accepted

Answered
Why function need more variables
time = ... some values data = ... some values f = freq(time,data) % this is how you call a function Google "how to call a fun...

7 years ago | 0

Answered
How to add numeric values to table description?
t.Properties.Description = "This table is the data from user number " + a; % or t.Properties.Description= sprintf('This table ...

7 years ago | 0

| accepted

Answered
making each column a stand alone variable
Wanted = num2cell(E,1) % keep it this way, don't think of naming etc, etc...,

7 years ago | 0

Answered
Extracting and sorting data in a column
Works for odd as well as even number of elements: NewMx = max(reshape([Mx(:);... -Inf(mod(numel(Mx),2))],2,[])) % thank y...

7 years ago | 0

Answered
Average of matrix element
cumsum(matrix)./(1:numel(matrix)) % where matrix is a column vector

7 years ago | 0

Answered
Row Number Returned During Iterations
Iterator indicates which row satisfied that condition , so why not save it?

7 years ago | 0

| accepted

Answered
displaying the sorted result
Use sort() and fprintf().

7 years ago | 0

| accepted

Answered
how to select particular rows of a column vector repeatedly?
I’m not exactly sure what you mean, perhaps: vector(repmat([3,4,5],1,10)) edit: vector(sort([3:12:360,4:12:360,5:12...

7 years ago | 0

| accepted

Answered
Maximum values of an matrix
Values=sort(A(:),'descend'); Values(2) % 2 - second max value

7 years ago | 1

| accepted

Answered
Plot a vector with different colors on selected data
No loops needed: v = reshape(vector,100,[]); plot(v(:,1:2:end),'r') hold on plot(v(:,2:2:end),'b')

7 years ago | 1

Answered
How to fill a cell array without using a loop
I'm not sure of any other method but here is one with implicit loop: c = arrayfun(@(x) -x:x, a,'un',0) celldisp(c) Or another...

7 years ago | 1

| accepted

Answered
How to find in cell structures?
v=cellfun(@(x) any( x == 5 ), yourcell); Wanted = find(v) % Adam was almost right , but a minute tweak

7 years ago | 0

| accepted

Answered
Converting cell arrays back to matrix
cell2mat(mat_cell)

7 years ago | 0

Answered
How to vectorize assignment from array of structures to cell array
C = {s.pet} % is giving you the desired result already

7 years ago | 0

| accepted

Answered
Remove random columns from a big matrix?
B(:,randperm(size(A,2),3000))=[]

7 years ago | 0

Answered
How to make a cell array of cell arrays
Wanted = num2cell(reshape(A,5,[]),1).'

7 years ago | 0

Answered
how can i solve a circuit with 2 loops and 2 sources in matlap ( finding I1 and I2) ?
[I1,I2]=solve(2*s*I1+I1-I2+1/s*I1-1/s*I2==1/s,1/s*I2-1/s*I1+I2+3*I2+s*I2==-2/s,I1,I2) % no semicolons at the end

7 years ago | 1

| accepted

Answered
Create a new vector by adding and subtracting each element of original vector.
B = reshape(A + [-1;0;+1],1,[]) % or B = reshape(bsxfun(@plus,A,[-1;0;+1]),1,[]) % if < = 2016a

7 years ago | 1

| accepted

Answered
How to assign numbers
a = [1 2 3 0 4 5 0]; a(~a) = max(a) + (1:nnz(~a))

7 years ago | 2

| accepted

Answered
How to find the index of maximum value in matrix
[Value, Position] = max(abs(A(:,2))) A(Position,1) % corresponding ID

7 years ago | 1

| accepted

Load more