Answered
Creating a position Vector
C = find(ismember(A,B))

7 years ago | 0

| accepted

Answered
isolate the odd and even integers in the matrix.
function [B,Even,Odd] = problem2 A = input('Enter Values: '); % input must be [4,2,6,3,5] for example , don't forget the [ ] B...

7 years ago | 1

Answered
List(Vecor) Generation
m=3; % pairs n=4; % n combinations reshape((0:n-1)+(1:m)',1,[])

7 years ago | 0

| accepted

Answered
How to remove k = 3 that part?
You have some doubts regarding using a function , I suggest you to read <https://in.mathworks.com/help/matlab/matlab_prog/crea...

7 years ago | 0

Answered
Remove NaN from cell array
S=[y_fast{:}]; ix=cellfun(@(x)any(isnan(x.OutList)),y_fast); y_fast(ix)=arrayfun(@(x)rmfield(x,'OutList'),S(ix),'un',0)

7 years ago | 0

| accepted

Answered
Remove field from structure nested in a cell array
cellfun(@(x)rmfield(x,'Outdata'),y_fast,'un',0) % see the quotes around Outdata doc rmfield help rmfield

7 years ago | 0

| accepted

Answered
Sorting a m x n matrix
reshape([1;2;3;4;5;6;7;8;9],3,[])

7 years ago | 1

Answered
How to change all elements of a row if 1 value in a specific column is 0.
In=string(in); In(In(:,3)=="0",:)="*"; Wanted=num2cell(In) %or Wanted=in; Wanted([in{:,3}]=="0",:)={"*"} % ^^^^^^...

7 years ago | 0

| accepted

Answered
check values of all elements of an array
Use find() , logical operators also use ismember() to know the existence of those numbers.

7 years ago | 0

Answered
How to repeat the value of y to have the same length as x?
y = repmat(max(E),size(x))

7 years ago | 0

Answered
How to find the position of an element in a vector
find(x==2)

7 years ago | 0

| accepted

Answered
How to change radians into degrees?
As James says you can straight forward use atand() note when you use tand() the result is expressed in degrees. Therefor there i...

7 years ago | 0

Answered
Eliminate the var of the first line of .txt
writetable(A,'TEST.txt','Delimiter',' ','writevariablenames',false)

7 years ago | 1

| accepted

Answered
Matrix function [row:column] help
https://in.mathworks.com/help/matlab/ref/colon.html#description - second example in description explains clearly What you get i...

7 years ago | 3

| accepted

Answered
Find Row and Column in Cell Array
Never name a variable table because it will shadow the inbuilt function. [row,column] = find(strcmp(TAble,'Activity desc.')) [...

7 years ago | 1

| accepted

Answered
Error using ==> mrdivide Matrix dimensions must agree.
https://www.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html x = linspace(0,500,30); y = exp(1 ./ x); p...

7 years ago | 0

Answered
How to differentiate several symbolic functions?
syms L10(a) L1(a,u) epsilon1(a,u) L10(a) = 2*a; L1(a,u) = sqrt((2*a)^2+u^2); epsilon1(a,u) = (L1(a,u)-L10(a))/L10(a); df = d...

7 years ago | 1

| accepted

Answered
Finding all rows in matrix matching rows in another matrix
indB = find(ismember(B,A,'rows'))

7 years ago | 2

| accepted

Answered
How to limit the number of row?
data(1:1050,:) % Provided that the data always has atleast 1050 rows

7 years ago | 0

| accepted

Answered
Repeat rows of matlab
repmat(matrix,10,1)

7 years ago | 1

| accepted

Answered
Is it possible to 'clear all' variables except one?
<https://in.mathworks.com/help/matlab/ref/clearvars.html#bt3p8gt-5> clearvars -except var

7 years ago | 0

| accepted

Answered
How can i transform a symbolic variable to numbers?
Use subs() and then use double() doc subs doc double

7 years ago | 0

| accepted

Answered
What does mean this X=[A'B'C'] ??
Why not try it in command window?? A,B and C are turned into column vectors and are horizantally concatenated with each other. ...

7 years ago | 0

| accepted

Answered
how to find the line number of a point in a vector
Start = strfind([0,ii],[0 1]) End = strfind([ii,0],[1 0])

7 years ago | 1

| accepted

Answered
Create a subtable with specific values in a column
ix = ismember(Maintable.ID, [1245 1097 1893 1235 1514 1023 1071 1026 1009 1061 1033 1059 1551 1042 3008]); Subtable = Maintable...

7 years ago | 0

| accepted

Answered
How Can I put some numbers in a sym and sum its cells?
syms a b c d B = [ 1 2 ; 3 4] ; x = reshape(B(:,1),1,1,[]); y = reshape(B(:,2),1,1,[]); A = [ a*(x.^2)+y , b*(y.^3)+x ; ...

7 years ago | 0

| accepted

Answered
inserting rows in a matrix
Wanted=zeros(365*25,1); Wanted(1:25:end) = yourmatrix

7 years ago | 0

Answered
vectorB(n) = sum(vectorA(1:n)) without a loop
Perhaps you just want cumsum() help cumsum doc cumsum Or you just need: v= accumarray(n(:),n(:),[],@(x) sum(vectorA(1:x))); ...

7 years ago | 0

| accepted

Answered
subtracting two vectors to get one value
Why not vector1 - vector2 %? If they are of different sizes: bsxfun(@minus,vector1,vector2.') % < 2016b % else it's simply ...

7 years ago | 0

Load more