Answered
Convert 3-D matrix/table to character string
sprintf('%f ',reshape(threeddata,1,[]))

7 years ago | 0

Answered
imshow() not working , try a lot times
Read this once again: You have a custom file named image.m please move it from MATLAB's path or rename it.

7 years ago | 0

| accepted

Answered
put number in cell
B = num2cell(~cellfun('isempty',A) * .2)

7 years ago | 0

| accepted

Answered
How to save results with greek letters for importing into publish command
Z=sprintf('coordinate = %0.2e %s %0.2f %s',... 10,char(8737),pi,char(186)); writetable(table({Z}),'sample.txt',... 'W...

7 years ago | 0

Answered
Removing NaNs columns in matrices within cell array
nonancellA = cellfun(@(m) m(:,~any(isnan(m),1)), X, 'UniformOutput', false)

7 years ago | 0

| accepted

Answered
Finding the index of spesific element in a matrix?
Assuming you want to index of the last match in the matrix: Index=find(a==3,1,'last') <https://in.mathworks.com/company/...

7 years ago | 3

| accepted

Answered
Index exceeds the number of array elements (100001)
for k = 1:numel(z)-1

7 years ago | 0

Answered
How to read specific data from a text file
Simpler: S=fileread(filename); sscanf(S,'Station %f N %f')

7 years ago | 1

Answered
multiply table and matrix
I prefer Adam's method : although if you want to multiply table with matrix then=> arrayfun(@(x) A{:,x}*B(x),1:numel(B),'un',0...

7 years ago | 1

| accepted

Answered
Find cell with nearest value
C = [yourcell{:}]; % assuming each cell contains a scalar [Value,Where] = min(C(C>0 & C<1))

7 years ago | 0

| accepted

Answered
Split Table at certain rows with for loop
v=[1 500 900 1200]; % ^--appended 1 at the beginning Splittable=cell(numel(v)-1,1); for k=2:numel(v) Splittable{k-1}=T...

7 years ago | 2

| accepted

Answered
Combining multiple plots in 1 graph
Read this once again: Use hold on after the first plot() call and indeed remove subplot()

7 years ago | 0

Answered
simple structure problem (return field name)
Since it's your assignment: 1) Use arrayfun() for Sight using sum() assuming the max sum is the best Sight. 2) max() the resul...

7 years ago | 0

Answered
Why must have brackets around 'student'?
https://in.mathworks.com/help/matlab/matlab_prog/generate-field-names-from-variables.html - this is why

7 years ago | 1

| accepted

Answered
How to check if cell has particular value or not?
contains() - if it contains "NaN" a string isnan() - if it contains NaN value

7 years ago | 1

| accepted

Answered
XMIN must be a floating point scalar when xmin is from vpasolve
They are of symbolic type to convert them use double() : xmax=double(solx(3)); xmin=double(solx(4));

7 years ago | 1

| accepted

Answered
find a max value in function
Add the below after mesh() call: mx = z==max(z(:)); mn = z==min(z(:)); hold on plot3(x(mx),y(mx),z(mx),'ok') plot3(x(mn),y(...

7 years ago | 0

| accepted

Answered
How can i find properties of value that coming from which array&cell?
Use the second output of *max() & min()*

7 years ago | 0

| accepted

Answered
Vector inside another vector
People don’t do homeworks here. Index K>=S to U1 lhs and S rhs by equating against each other. Since it’s your homework see Alex...

7 years ago | 0

Answered
how do i generate conditional random number either 0 or 1 ?
adj_mtr(dist_mtr > 0 & dist_mtr <= 2*r) = randi([0, 1],1,nnz(dist_mtr > 0 & dist_mtr <= 2*r));

7 years ago | 0

Answered
How do I write matrix function with symbolic expression
Since it’s your homework: <https://in.mathworks.com/help/symbolic/solve.html#bup_5dp-1>

7 years ago | 0

Answered
Find overlap between 2 arrays?
intersect(A,B)

7 years ago | 0

| accepted

Answered
why is my code not working?
Probably you want (no loops needed): ii = linspace(0.0001,0.0009,1000); Fm = (0.25).*(((log((2.7*10^-5)+... (2.51.*((Rey....

7 years ago | 1

Answered
Hi , i have a matrix and need to extract the column in this way , thank you
idx= [ 1 5 9 13 ]; A(:,idx) % 4 X 4 A(:,setdiff(1:size(A,2),idx)) % 4 X 12

7 years ago | 0

| accepted

Answered
[DISCONTINUED] MATLAB Answers Wish-list #4 (and bug reports)
Sometimes deleting answer after moving is impossible for instance the below thread: https://in.mathworks.com/matlabcentral/answ...

7 years ago | 0

Answered
Having trouble to solve equations
Use fsolve(): E=1.42; F=@(x)[((E+x(1))*0.1+(-x(2)-7*x(3))*(((E+x(1))*(E+x(1))*(E+x(1))*(E+x(1)))/(((E+x(1))*(E+x(1))*(E+x(1))...

7 years ago | 1

| accepted

Answered
i am not getting correct output.please help
e = eccentricity(1,2) % function call function e = eccentricity(a,b) % function definition , a & b assumed as scalars for thi...

7 years ago | 1

| accepted

Answered
Why am I not getting the plot results?
Because you missed the dot operators: https://in.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html The bel...

7 years ago | 1

| accepted

Answered
sorted two different arrays
[~,idx]=sort(T{:,1}); % T your table C(idx,:) % C your cell become sorted according to first column of table T(idx,:) ...

7 years ago | 1

| accepted

Answered
is there such a matrix operator
sum(X .* Y)

7 years ago | 1

| accepted

Load more