MATLAB Answers Wish-list #5 (and bug reports)
Whenever a text is edited by mobile [safari browser] , the click produces superfluous three letters " ltr " , which is really fr...

12 days ago | 0

Comparing two matrix elements summing third and storing them separately
T = array2table(A); t = groupsummary(T,{'A1','A2'},'sum'); x = t{:,[1,2,end]}

13 days ago | 0

How to stop matlab from truncating long decimal numbers
The decimals are not truncated it’s just the appearance in command window: doc format doc sprintf

13 days ago | 0

contour and contour plot 3 not working
.^

13 days ago | 0

how can remove the rows and columns which has ones in all
use *all()* for columns and rows separately , make a copy of A to B and finally remove the unwanted

13 days ago | 0

| accepted

how to to address a specific cell
Use *find()* to know their indices: doc find

13 days ago | 0

How to replace numbers in a column vector after certain elements?
X(600+1 : end) = 0;

13 days ago | 0

| accepted

Checking for conditions in Dataset
M = sort(matrix(:,specific_column)); top_5 = M(1:5); top_5_greater_than_50 = sum(top_5) > 50; There_exist = any(matri...

14 days ago | 0

Saving data from loops
What values are you going to store? The chosen_index is for sure a scalar because as soon as the condition is satisfied once the...

14 days ago | 0

remove Nan from a row vector using if statement only
*isnan()* would suffice your need doc isnan

14 days ago | 0

| accepted

Save data from while loop
You don’t need a loop , simply define t as t = 0:dt:100; doc while % to know more about the loop doc for and use element wi...

15 days ago | 0

how to code variable to code

17 days ago | 0

A question related to subs in ode (symbolic maths toolbox)
I am not sure what you are asking for perhaps an example below?: >> syms x y >> eqn = x+2*y eqn = x + 2*y >> subs(...

17 days ago | 0

| accepted

How to get row index satisfy the condition in cell array
The last column doesn't seem to be a char: data(cell2mat(data(:,end))==1,:)

21 days ago | 1

| accepted

Convert Cell to Matrix
As sir Walter mentioned already , you cannot have holes in matrices . So you could replace them with nans perhaps: cell_A(c...

24 days ago | 0

| accepted

Scalar Multiplication of different values at same time
Assign the values with one output for instance as variable X which consists all the values in it.

24 days ago | 0

how to fill pre allocated matrix using two columns vectors
% Illustration Matrix = zeros(5); X = (10:10:50).'; % column vectors Y = (40:10:80).'; Matrix(end,:) = X.'; Matrix(:,1) = ...

24 days ago | 0

Converting a cell type data to a 4d format
Try this: AA=cellfun(@(x) x.',A,'un',0); Wanted = cat(4,AA{:})

24 days ago | 0

| accepted

Indexing error when using the plot function.
clear all % you have a variable named plot

26 days ago | 2

How to make a .csv file with data values in .txt
T = readtable('data.txt'); T1 = str2double(table2cell(T)); csvwrite('Wanted.csv',T1(~all(isnan(T1),2),:)) % after this the cs...

26 days ago | 1

Check Positive or Negative Infinity
sign(abc) .* isinf(abc)

26 days ago | 1

| accepted

Cell Array with different sizes
"Ich would like to read them seperately now in variables." Terrible idea see https://in.mathworks.com/matlabcentral/answers/3...

26 days ago | 0

| accepted

How can I get the X and Y coordinates from an fplot graph? or from a function by parts?
h = fplot(mfinalres,[0,20]); x1 = h.XData y1 = y.YData

26 days ago | 0

| accepted

How to assign only first member in matrix
q(t) = find(A == max1(t),1,'first')

26 days ago | 0

| accepted

How to randomly and uniquely select 2000 samples from an array with 1x460800.
val(randperm(numel(val),2000))

26 days ago | 1

| accepted

ode45 or dsolve
tspan=[0 4]; y0=[0.02;0]; m=5; k=1000; c=1000; [t,y]=ode45(@(t,y)unforced1(t,y,c,m,k),tspan,y0); % function call plot(t,y(...

26 days ago | 0

| accepted

for loops not working
The same goal can be achieved trivially using meshgrid() or ndgrid() without a loop: % Modes on a plate Lx=0.286; % length of...

26 days ago | 0

| accepted

How to extract column and row index and the corresponding value from a matrix?
m = [0 1 4 7 6 0]; [Rows,Columns] = ind2sub(size(m),(1:numel(m))'); Wanted = [Rows,Columns,m(:)]; Wa...

27 days ago | 1