Answered
Save arrays in a structure
doc cell2struct

7 years ago | 0

| accepted

Answered
If the integral decomposition solution is not obtained, what integral method can be used to get the closest value?
[d a z d a0 a1 a2 a3 a4 alpha0 alpha1 alpha2 alpha3 alpha4 rho hgang phi]=deal(1); % if all the value except the r are 1 syms r...

7 years ago | 0

| accepted

Answered
matlab function "solve" couldn't solve correctly
fsolve(matlabFunction(g-x),[-1,2]) % you can also use vpasolve() with random set to true in a loop to see the possibilities

7 years ago | 0

| accepted

Question


Why do I get .txt extension eventhough it isn’t?
Whenever I download a .mat file from this forum I get .txt extension appended at the ended. Why is it so ?

7 years ago | 1 answer | 0

1

answer

Answered
Shorten code for a function
m=cell(5,1); for k=1:5 m{k}=fnP(result,k); end

7 years ago | 0

| accepted

Answered
How can I transform two values separted by _ of one colum in two columns?
s='78.5888_2.027' str2double(regexp(s,'\d+[\.?]\d*','match'))

7 years ago | 0

Answered
‘’fprintf‘’ cannot be used in a loop?
fprintf('equation%d=%s',i,char(x^2+y^2))

7 years ago | 0

| accepted

Answered
Documentation about multi-line array (matrix) definition?
https://in.mathworks.com/help/matlab/matlab_prog/matlab-operators-and-special-characters.html

7 years ago | 1

| accepted

Answered
How to assign values to 100 by 2 matrix?
By the looks of the question probably you want: % if you want first columns with 2 and the other as 3 then ones(100,2).*[2,3] ...

7 years ago | 1

| accepted

Answered
iimage not showing in ginput()
imshow()

7 years ago | 0

Answered
Expressing the double integral on matlab
<https://in.mathworks.com/matlabcentral/answers/462160-expressing-the-double-integral-on-matlab#comment_705243>

7 years ago | 0

| accepted

Answered
how do i use this rfplot(___,lineSpec)
I don't have that toolbox but if you know how to use rfplt(...) then linespec is just https://in.mathworks.com/help/matlab/ref/l...

7 years ago | 0

Answered
adding a blank row after a populated row on a Table
t1=repmat({'empty'},size(T)); D=cell(2*size(T,1),size(T,2)); D(1:2:end,:)=t1; D(2:2:end,:)=table2cell(T); Wanted=cell2table(...

7 years ago | 1

| accepted

Answered
how to plot meshgrid and mesh
Remove last line.

7 years ago | 1

| accepted

Answered
How to extract a field from a structure in a 'for loop', so that it would behave like an array?
Note: Don‘t ever name a variable sum it would hinder the inbuilt function sum(). Also size(s) should be length(s). S = T.(sprin...

7 years ago | 0

| accepted

Answered
Automatically insert end for if statements and for loops
It's possible in live editor.

7 years ago | 0

Answered
I am B.Sc.Medical Imaging Technology final year student. I am completely new to this MATLAB platform.
I suggest you to do <https://matlabacademy.mathworks.com/ *MATLAB ON-RAMP*>, only takes few hours to cover the basics of MATLAB....

7 years ago | 2

| accepted

Answered
Hi everyone ! can anyone help me to do this , thank you
[~,n]=size(X); xai=[1:4:n,2:4:n]; xbi=[3:4:n,4:4:n]; Xa(:,xai)=X(:,xai) Xb(:,xbi)=X(:,xbi)

7 years ago | 0

| accepted

Answered
extract multiple submatrices from a large matrix based on specific criterion
T=readtable('mydatfile.csv')% Note here it’s just your filename; Wanted = T(T.id==23,:) %

7 years ago | 0

| accepted

Answered
finding the computation for n columns
Z=z{:,:}; K = 3; c1 = sort(Z(1:2:end,:)); c2 = sort(Z(2:2:end,:)); s1 = sum(c1(1:K,:))./sum(c2(1:K,:))

7 years ago | 0

Answered
how to write a matrix to text file with loop name of .txt
sprintf('%d.txt',i) % this would be your filename inside the loop

7 years ago | 0

| accepted

Answered
Sum and Average of column in Matrix
Wanted=T(:,'Duration90s');% here T is your table % Google how to access data from table sum(Wanted) mean(Wanted)

7 years ago | 0

| accepted

Answered
set figure title in a loop
saveas( gcf, sprintf('TruncatedPowerFunc_%d',N),'epsc');

7 years ago | 0

| accepted

Answered
How do I combine multiple plots in a for loop with different colors?
https://in.mathworks.com/matlabcentral/answers/151011-how-to-plot-a-line-of-a-certian-color#answer_148761

7 years ago | 0

Answered
How to let the user enter 6 different numbers which are different from each other?
help logical help input help while help break

7 years ago | 0

Answered
Count the same element in a large rows of one column
uniquevalue = 9; % for example nnz(matrix==uniquevalue)

7 years ago | 0

Answered
Finding value of a row number in an array, error
c(2,3) % basic indexing , second row and third column

7 years ago | 1

| accepted

Answered
Array indices must be positive integers or logical values.
Because indexing starts from one https://matlab.fandom.com/wiki/FAQ#How_do_I_fix_the_error_.22Subscript_indices_must_either_be_r...

7 years ago | 0

| accepted

Answered
Pad empty spaces in matrix with 0
C={[1 4 6 3 7 3] ;... [4 6 2 9] ;... [5 5 8 2 5] ;... [4 8 1 3 9 4] }; M=max(cellfun('prodofsize',C)); Wante...

7 years ago | 2

Load more