Réponse apportée
How does MATLAB generate the probability density function?
PDFs are calculated from their definitions. They are not simulated. Example, calculating a standard normal PDF and comparing ag...

plus d'un an il y a | 1

Réponse apportée
Error creating array with evenly spaced elements
Find the index of the element in F that is closest to 62.3: [~,id] = min(abs(F - 62.3))

plus d'un an il y a | 2

Réponse apportée
point inside an area
The coordinates in x_boundary and y_boundary don't specify the polygon you mean to specify, because the points are out of order....

plus d'un an il y a | 0

| A accepté

Réponse apportée
Error using plot Invalid data argument.
Try replacing x = t.ModelName; with x = categorical(t.ModelName); And run the code again. If that doesn't w...

plus d'un an il y a | 0

Réponse apportée
How to permanently hide the toolbar for an axes even after replotting
You can delete it, e.g.: delete(gca().Toolbar)

plus d'un an il y a | 0

Réponse apportée
Why won't my computer display the top of the output? Why does it cut if off?
Most likely the number of lines output to the Command Window exceeds the command window scroll buffer, which by default is 5000 ...

plus d'un an il y a | 0

| A accepté

Réponse apportée
How can I repeat row and column extraction of a matrix until the end of the matrix is reached?
M = rand(1015,2); incr = 145; m = size(M,1)/incr; n = size(M,2); newM = reshape(permute(reshape(M,[],m,n),[1 3 2]),[],m*n)...

plus d'un an il y a | 1

Réponse apportée
I am getting wrong results for the Continuous wavelet transform (CWT) on converting the frequency axis (Y Axis) from log scale to linear scale for the same frequency limits.
Use a surface rather than an image. A surface allows you to use arbitrary x and y values, whereas an image requires linearly spa...

plus d'un an il y a | 0

| A accepté

Réponse apportée
How to get a single output from a function with 2 inputs and 3 possible outputs depending on the choice made for inputs.
Here's one option: rot('x',pi/3); function rotmat=rot(axis,rotation) switch axis case 'x' rotmat=[ 1 ...

plus d'un an il y a | 0

Réponse apportée
How to provide a positive and negative value for the tolerance value?
"I want the tolerance value to be both positive and negative" Use abs. However, you also need to compare the current result wi...

plus d'un an il y a | 2

| A accepté

Réponse apportée
Eliminate Nan row in a large matrix
A(any(isnan(A),2),:) = [];

plus d'un an il y a | 0

| A accepté

Réponse apportée
Is it possible to realize such loop in MATLAB?
x = 10; n_iterations = 5; results = zeros(1,n_iterations); r = 1; for ii = 1:n_iterations r = r*(x-ii); results(...

plus d'un an il y a | 0

| A accepté

Réponse apportée
Combining text with non-zero elements of a 2D array
Here's one way: N=[10 0 0 0 0; 0 20 0 0 0; 10 0 20 0 0; 0 0 0 10 0; 0 0 0 0 30] C={'ABC';'DEF';'GHI';'JKL';'MNO'} n_col = siz...

plus d'un an il y a | 0

Réponse apportée
Combining text with non-zero elements of a 2D array
Here's one way: N=[10 0 0 0 0; 0 20 0 0 0; 10 0 20 0 0; 0 0 0 10 0; 0 0 0 0 30] C={'ABC';'DEF';'GHI';'JKL';'MNO'} n_col = siz...

plus d'un an il y a | 0

Réponse apportée
Is there a meaningful guideline on when to use parentheses vs square brackets vs curly brackets in writing MatLab code?
If you share a particular snippet of code that is confusing, someone here can probably explain it. (Of course, that code may be ...

plus d'un an il y a | 2

Réponse apportée
How do I print a % character into a file
fprintf(app.SessionFile,"%s",str);

plus d'un an il y a | 0

| A accepté

Réponse apportée
How do I create a timetable from a file that contains several data columns with associated time columns?
txtArray= {'Sig1_Time' 'Sig1_Value' 'Signal2_Time' 'Sig2_Value' 'Sig3_Time' 'Sig3_Val...

plus d'un an il y a | 0

| A accepté

Réponse apportée
Why is my table getting all the same values when it shouldn't?
The basic problem is that R and C are vectors, and the Simulink model appears to only use the first element in that case. The s...

plus d'un an il y a | 1

Réponse apportée
how do I load zip file in matlab code?
Use <https://www.mathworks.com/help/matlab/ref/unzip.html unzip> to extract the files from the zip archive. Then read/load the r...

plus d'un an il y a | 0

Réponse apportée
How can I write data to a text file in a user-specified location that is already populated with a standard header?
You can call writematrix with 'WriteMode','append' to write the data to a text file that already contains the header. So the co...

plus d'un an il y a | 0

| A accepté

Réponse apportée
How to correctly adjust the FaceColor property of patch objects in a figure with a legend?
fig = openfig('cylinder.fig','visible'); There are actually 12 patches in the figure all_patches = findall(fig,'Type','patch')...

plus d'un an il y a | 1

| A accepté

Réponse apportée
undo a command in matlab plotting in 2d
In the figure window go to Tools menu > Edit Plot. Using the mouse cursor select the line you want to remove, then either right-...

plus d'un an il y a | 0

Réponse apportée
Issue with plotting order
Data = readmatrix("FigureOfMeritResults.xlsx"); % Extract data Date = Data(469:1908,1); FoM = Data(469:1908,3); GHI = Data(4...

plus d'un an il y a | 0

Réponse apportée
Plots coming out weird
You likely have pre-existing X and Y variables in your workspace, which are being plotted in their entirety. Since the code show...

plus d'un an il y a | 0

Réponse apportée
Separating and indexing (k-wave) datasets to different planes/coordinates
One way to separate the the data for the two sensors is using the following approach % Extraer resultados de sensor1 y sensor2 ...

plus d'un an il y a | 1

| A accepté

Réponse apportée
assign the fields of a structure correctly
Assuming the set of table variable names is the same between d1 and app.Preset_UITable.Data (but potentially in a different orde...

plus d'un an il y a | 1

| A accepté

Réponse apportée
Why converting from Spherical to Cartesian using the command "sph2cart" gives different values than converting it manually by writing the equations of each coordinate?
Assuming theta is azimuth and phi is elevation, your equations would be (from the documentation): x = r .* cos(phi) .* cos(thet...

plus d'un an il y a | 1

| A accepté

Réponse apportée
Turning a 1x3001 array into a 14x3001 array to make two things the same size and perform math on them...
You don't have to explicitly repeat the 1x3001 row vector 14 times in order to add it to the 14x3001 matrix. Here's an example ...

plus d'un an il y a | 0

| A accepté

Réponse apportée
how to make figure full axes
Setting the figure's WindowState property to 'fullscreen' may achieve the desired effect, e.g.: fig = figure('Units', 'pixe...

plus d'un an il y a | 1

| A accepté

Réponse apportée
Why do I get "Array indices must be positive integers or logical values" error ?
When i is 100, Per(100-i) is Per(0), which causes the error since 0 is not a valid index in MATLAB.

plus d'un an il y a | 2

Charger plus