Answered
change last element in array by specific value matlab
Result = a; if Result(end) == specific_value % specific value is 9 for example Result(end) = 1; end

7 years ago | 0

| accepted

Answered
How to obtain the minimum values of an array?
Have a look at *mink()* else use *sort()* and pick the first four values if you’re using older version.

7 years ago | 1

| accepted

Answered
Storing Cell elements in a single matrix
a = cat(3,yourcell{:})

7 years ago | 0

| accepted

Answered
how does a diff operation works for relational and logical cases with arrays ?
A = [14 5 6 14 32]==14 % Split it into two lines diff(A)

7 years ago | 0

Answered
What is an elegant way to pack and unpack an array of structures to/from a single vector?
z = struct2cell(data); x = [z{:}] data = cell2struct(z,{'r','v','m'}) % reverse

7 years ago | 0

Answered
Selection of Matrix Elements without for loop
B(sub2ind(size(B),A(:,1),A(:,2)))

7 years ago | 1

| accepted

Answered
2D matrix to 3D
repmat(a,1,1,max(a(:))) % where a is your matrix if you have decimals in your matrix then use round function for max() to make...

7 years ago | 0

Answered
how to sort 2 columns values based on one column
[~,idx]=sort(matrix); matrix(idx,:) % first column sorted in ascending order if vice versa use 'descend' option

7 years ago | 1

| accepted

Answered
How do rewrite a variable with the symbolic toolbox?
syms a b eq=a==b+3 isolate(eq,b) %or b=solve(eq,b)

7 years ago | 0

| accepted

Answered
how i can store array of string for every loop
<https://in.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html>

7 years ago | 0

| accepted

Answered
Creating vectors from rows of matrix
Subvectors = reshape(V,1,b,[])

7 years ago | 0

| accepted

Answered
how to recognize if column is greater or row????????
if output(1) > output(2) disp('Row is greater than column') elseif output(1) < output(2) disp(' Column is great...

7 years ago | 0

Answered
How to access/manipulate data from cell arrays?
result{k} = x(:,2); To produce a numeric matrix you need to append with nan or zeros at the end. M=max(cellfun('prodo...

7 years ago | 1

Answered
How to save the data every time i run 3 For loops?
K1 = 170000:5000:210000; B1 = 0:10:100; M1 = 1:0.05:1.2; kn = numel(K1); bn = numel(B1); mn = numel(M1); mat=zeros(kn,bn,m...

7 years ago | 0

| accepted

Answered
error saving a struct
<https://in.mathworks.com/help/matlab/ref/save.html#btppzj8-1_2> - *A* should be *'A'*

7 years ago | 0

| accepted

Answered
Please anyone help me with the output?
disp(vpa(twc1))

7 years ago | 0

Answered
Please help me with the problem?
Use *[u;l]* instead of *u,l*

7 years ago | 1

| accepted

Answered
Remove missing from cell array
yourcell(cellfun(@ischar,C))

7 years ago | 0

Answered
How to display a matrix which has elements with big difference in values?
format longg doc format

7 years ago | 0

| accepted

Answered
new script new window
<https://in.mathworks.com/matlabcentral/answers/159580-in-matlab-2014b-how-can-i-undock-the-editor-into-one-window-but-dock-all-...

7 years ago | 0

Answered
comparision of cell elements
First and foremost don’t ever use *cell* as a variable name: isequal(yourcell{:}) % to check all the elements are equal to ...

7 years ago | 2

| accepted

Answered
Convert string form to array form on Matlab
sprintf('%d',1234) str2double('1234')

7 years ago | 0

Answered
How to find a column with a specific set of numbers
Columns = find(all(matrix==[6;0;0]))

7 years ago | 0

Answered
error in the programming
It means you’re trying to access an element which doesn’t even exist. For example: x=1:5; x(6) % 6 th element doesn’t ex...

7 years ago | 0

Answered
Please anyone help me with the error!
fprintf('The potential difference is \n') disp(potential)

7 years ago | 1

| accepted

Answered
CalendarDuration with a number (double)
Datas=seconds(array-array(1)); % array in format "dd-MMM-yy hh:mm:ss.SSS" Now use Datas for comparison.

7 years ago | 1

| accepted

Answered
Finding a range in an array
idx = (array>=20) & (array<=25.6); array(idx) = -array(idx)

7 years ago | 2

| accepted

Answered
I need to write a function that accepts matrix as input and returns a square matrix
So basically we would suggest like this for homeworks: help size help logical help function https://matlabacademy.mathworks....

7 years ago | 1

Answered
Matrix value change with conditions (x=y*(mask==1))
(* performs matrix multiplication) perhaps you needed .* element wise multiplication https://in.mathworks.com/help/matlab/matla...

7 years ago | 1

| accepted

Answered
How can I solve randperm error with words?
[x,y]=ndgrid(Tile); xy=[x(:),y(:)]; xy(~strcmp(xy(:,1),xy(:,2)),:)

7 years ago | 0

| accepted

Load more