Réponse apportée
How do you change the transparency of multiple lines using "plot" if the lines are all different colors?
h = plot(rand(5)); % example plot. When you make your plot be sure to capture the handle % now set the alpha on all the lines ...

presque 4 ans il y a | 0

Réponse apportée
Rounding towards zero or from zero
There is no tie involved in rounding 3.6. If you wish, you can use floor instead: floor(3.6) If x was 3.5 instead, that would...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
Is it possible to have a file that changes it name depending on another variable?
Try this: % Button pushed function: SaveButton function SaveButtonPushed(app, event) PatientID = app.PatientI...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
Condense code in Split string operation
If you put the filename in a string instead of a char vector you can do it in one line s = "xxx_yyy_zzz.xlsx" extractBetween(s...

presque 4 ans il y a | 1

Réponse apportée
increasing amplitude of sine wave
Fs = 44100; dt = 1/Fs; StopTime = 3; t = (0:dt:StopTime-dt)'; Fc = 3000; A = linspace(0, 1, numel(t))'; y = A.*sin(2*pi*Fc...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How to search for previous values in a table?
This should do what you want. Note that the cell array in this case only has one cell because there are only two timestamp rows...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Match two variables list
Perhaps what you want is this: c = ["80ms,110ms", "110ms,140ms", "140ms,195ms", "195ms,250ms", "250ms,400ms", "400ms,550ms", "5...

presque 4 ans il y a | 0

Réponse apportée
Formatting a vector to not include the first value
It seems like you could benefit from taking this introduction to using Matlab: Matlab onramp This is an example of very basic ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Using plot handle to replot a graph
Read the documentation for the copyobj function. Here is an example: x = 0:0.1:10; y = [sin(x);cos(x);tan(x)]; for i = 1:3; ...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
how do I swap both axes in the current plot
syms y U = y^2/2 - (3*y)/4; yrange = [0,1]; fp = fplot(U,yrange); plot(fp.YData,fp.XData) grid on

presque 4 ans il y a | 1

| A accepté

Réponse apportée
Code to determine a log of the mean for a column of numbers?
A = magic(4) logmean_col1 = log(mean(A(:,1))) max_col2 = max(A(:,2)) mean_col3 = mean(A(:,3)) mean_col4 = mean(A(:,4))

presque 4 ans il y a | 1

Réponse apportée
Find unique number sets
A = [1 4; 2 3; 3 2; 1 4]; B = unique(sort(A, 2), 'rows')

presque 4 ans il y a | 0

Réponse apportée
Why is Q=30 after the loop is ran?
B=1; Q=0; if B==1 && Q~=B Q=20; if B<0 || Q==20 % you just set Q equal to 20 on the line above so this condition is ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How to plot the bode plot extracted from LTspice in Matlab?
I used the import tool to import the data as fixed width data (right click on the file in the Current Folder and select Import D...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
If there is a coding "sqrt(sum(data(:,1:end).^2,2))" , so what is the function number 2 after comma?
That tells the sum() function to sum along the rows. See the documentation for sum here

presque 4 ans il y a | 1

| A accepté

Réponse apportée
Extracting data from a matlab figure and saving it as a .mat file
open('6000_1.fig') hl = findobj(gca, 'Type', 'line'); % find the lines x = get(hl, 'Xdata'); % extract the data y = get(hl, '...

presque 4 ans il y a | 2

| A accepté

Réponse apportée
Filling gaps in a vector using a secondary data set
rain1 = [nan nan 1:10 nan nan] % example data rain2 = [20:34] idx = isnan(rain1); % find where rain1 has nans rain1(idx) = ra...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Guessing the values of a function by using initial values
You don't have to "guess" the values of the function, you can just calculate them. Example x = [-20:.1:20]; y = x; [X,Y] = m...

presque 4 ans il y a | 0

Réponse apportée
Replacing Values in Matrix that are not equal to 1 while excluding 'NaN'
test1 = [ NaN 2 9 2 -.23 NaN 3 2 -1 -1 NaN 6 -.4 -1 -.57 NaN] test2 ...

presque 4 ans il y a | 0

Réponse apportée
Concatenating Edit Field value with an existing string in App Designer
First, if you are getting an error, that is usually what will help you (and us) figure out what is wrong so, please, post the co...

presque 4 ans il y a | 0

Réponse apportée
How to tick the parameter in the plot of a parametric function?
Try this (or something similar): % Your original code t = linspace(0, 1, 1000); x = t.^2; y = t.^3; figure plot(x, y, '-'...

presque 4 ans il y a | 2

Réponse apportée
Two easy questions (But I am confused)
Using smaller examples so we can see the results: S = magic(10) % sample matrix d = diag(S) % extract the diagonal elements %...

presque 4 ans il y a | 0

Réponse apportée
How to plot a 3-D "hotspot" figure
I would suggest looking at this example for the scatter3 function: scatter3 with varying marker colors You could use your f(x, ...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
How do I demagnify a help page?
Ctrl-Scroll Down will reduce the magnification

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How can I programmatically open the results of a command in a new window without setting it to a variable?
I can only think of a way to do this in two steps rather than one. result = 2 + 2; openvar('result'); This should work in des...

presque 4 ans il y a | 1

Réponse apportée
Efficient Way to find index of max column for each row
Are you wanting to find the column number of the maximum value in each row? If so, this is how you can do that: A = magic(5) %...

presque 4 ans il y a | 0

Réponse apportée
Too many output arguments (five on output)
You are defining this function as a function that takes 5 input arguments and returns one output argument. function y_cubic=cub...

presque 4 ans il y a | 0

Réponse apportée
Strange result in subtraction operation
The "obvious" result is 1.2e-14 not 1.12e-14 (the different last two digits in your original numbers at the 14 decimal place giv...

presque 4 ans il y a | 0

Réponse apportée
Removing quotation marks in a string using for loop
The quotation marks are not actually part of the string. It is just displayed that way. Plus, since you are using strings inst...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
What is this center line when I create m file from mlx file?
I believe that what you are seeing (if you are viewing these in the Matlab editor) is the "Right-hand text limit" line. You can...

environ 4 ans il y a | 0

| A accepté

Charger plus