Réponse apportée
Setting a value for multiple axes handles at once (without a for-loop)
Setting a value for multiple handles is pretty easy: set(axs,'Units','centimeters') getting values is a little trickier. For y...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Array of index, should return indexed values on the same array format
It sounds like weights = v(m); should work

presque 6 ans il y a | 0

Réponse apportée
How to find the mean of categorical data
check out splitapply. You may need to change the format of your data, but it does exactly what you want: G = findgroups(Day); ...

presque 6 ans il y a | 0

Réponse apportée
What is the inversion method used in (inv) function in MATLAB
read the documentation: "inv performs an LU decomposition of the input matrix (or an LDL decomposition if the input matrix is H...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
How would one tablize the iterations from a while loop with the variables at the top?
something like this will work, but may not be the most efficient depending on the number of iterations: tol = 1e-5; c_old = In...

presque 6 ans il y a | 0

Réponse apportée
Error: Array indices must be positive integers or logical values. Why??
you need a '*' between 'z' and the parenthesis. It is interpreting z(...) as indexing z

presque 6 ans il y a | 1

Réponse apportée
how to find max value of a function with a for loop
Loop isn't necessary unless you can't store the data in memory: e=y-(m*x-b); [e_max,idx] = max(e); x_max = x(idx); y_max = y...

presque 6 ans il y a | 0

Réponse apportée
Storing all for-loop results of a specific variable in .mat-file
Assuming all the produced data can fit in memory: for ta=1:20 a = 3; % save each value in an array va(ta) = (ta.*a)...

presque 6 ans il y a | 0

Réponse apportée
Select Specific Values in Matrix Based on Index Values Listed in Array...
Actually, you can index directly with 'b' after loading your variable into 'a': a(b,:) It may be possible to only load the row...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
For loop and indexing help
check out the discretize function

environ 6 ans il y a | 0

Réponse apportée
How to add both title and change the scale of a color bar
cb=colorbar(); cb.Label.String = 'Electric Potential Field, V'; cb.Ticks = -45:15:150; caxis([-45 150]);

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to locate significant points in a graph?
check out findpeaks

environ 6 ans il y a | 1

Réponse apportée
Using the result as a input in the loop again
Change Mw1(x)=(mW+M(x)/18.0); to % first iteration assumes Mw1(0) = 0 if x==1 Mw1(x)=mW; % later loops access the valu...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to sort a matrix by a predefined order
A=[1 2; 7 8; 5 6; 3 4]; B=[1; 4; 3; 2]; A = A(B,:);

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Question on using interpolate function
Check your data again. "data" is slightly less than 5 until x=0.485, and the first point exactly equal to 5 is x=1.71. You could...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Make an exception in ytickformat
x = rand(30,1); y = rand(30,1); scatter(x,y); ytickformat('%.2f') % get all the labels yt=yticklabels; % replace the first...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
how can I check if there is a cell in a structure?
Check the size of struct.hi. If the second dimension is size 1, then the struct.hi(1,2) doesn't exist if size(struct.hi,2) == ...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
copy figure to clipboard missing
This can be done with export_fig from Matlab Central: https://www.mathworks.com/matlabcentral/fileexchange/23629-export_fig exp...

environ 6 ans il y a | 0

Réponse apportée
create a matrix from matrix with zeros elements
I still don't quite see the pattern, but you can insert elements manually: x=[1 2 3 4 5 6 ; 7 8 9 10 11 12; 13 14 ...

environ 6 ans il y a | 0

Réponse apportée
Conversion from Cartesian X,Y,Z to domain-centric cylindrical coordinates
% example data X = 1000:1000:480000; Y = X; Z = sort(rand(size(X))); Domain_Center = [mean(X([1 end])) mean(Y([1 end])) mean...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to extract certain rows and columns with the readtable option for Excel files.
(edited) Using the import tool, then generating code and clearing unnecessary details, this appears to be the way: opts = spre...

environ 6 ans il y a | 1

Réponse apportée
Choose random element of vector
% select a random integer between 1 and the last index of the vector ind_1 = randi([1 length(vector)]); % select a random inte...

environ 6 ans il y a | 2

Réponse apportée
HOW TO DELETE A LINE FROM A CREATING FILE
T = cell2table; writetable(T([1 3:end],:),'file.csv')

environ 6 ans il y a | 1

Réponse apportée
statistical features for each and every pixel in the image
I don't think these features are defined for a single pixel. Similar to asking for the standard deviation of a single number

environ 6 ans il y a | 1

Réponse apportée
Plotting Lennard-Jones Potential
It looks like you are only plotting single points, so you might miss them in the plot. Also, what is the purpose of U in this sc...

environ 6 ans il y a | 0

Réponse apportée
Why is this showing this undefined error for "^" input argument?
fun=@(y) y.^2-5*y+6 is the syntax you want

environ 6 ans il y a | 0

Réponse apportée
How to find data values that falls on line connecting loglog plot in matlab
Your interpolation is linear. Compare: loglog(x,y,'-s',xq,yq,'r*'); and plot(x,y,'-s',xq,yq,'r*'); Log-log interpolation can...

environ 6 ans il y a | 2

Réponse apportée
Adding numbers in one column and move the values in second column accordingly?
% set up examples: a1 = [0,4,5,6,7]; a2 = [0.1,0.2,0.3,0.4,0.5]; a1_new = [0:7]; % find locations of a1 in a1_new [~,loc]=i...

environ 6 ans il y a | 0

Réponse apportée
Interpolation for n-dimensional array data
check out griddedInterpolant, I think it'll do what you want

environ 6 ans il y a | 0

Réponse apportée
discrete-time (D-T) real exponentials subplot
You're mixing the plot number up with the element of the series, try: % set the discrete values for plotting (n in x[n]) n = 0...

environ 6 ans il y a | 0

| A accepté

Charger plus