Réponse apportée
3D Plot from Excel data
OK, let's work with plot3. The relationships in the data might not be a suited to plot3, but this is a reasonable start. It's ...

plus de 5 ans il y a | 1

Réponse apportée
Stacked bar plot, assign "names" to color
Just add labels to your legend: labels = { 'Jack', 'Fred', 'abc', 'def' }; % fill out, as desired legend(labels);

plus de 5 ans il y a | 0

Réponse apportée
How to get all data from m-function?
Your function is defined to only return A (which is perhaps a scalar). To return multiples values, return them as elements in a...

plus de 5 ans il y a | 0

Réponse apportée
subtract value from column in table
You need to use braces: Scan{:,c} = (Scan{:,c}-minus);

plus de 5 ans il y a | 2

| A accepté

Réponse apportée
Noisy plot after deviation (no sensor)
@Bruce Rogers I added some filtering using MATLAB's smoothdata function. The result is a pretty good sine wave both for velocit...

plus de 5 ans il y a | 0

Réponse apportée
correct use of randsrc function
There are lots of ways to do this, I suppose. Here's what I put together -- with a pesky twist. The weighting is built-in to t...

plus de 5 ans il y a | 1

Réponse apportée
How to find the zero crossing in x and time data sets?
Here's what I put together. The variable fCross is what you are looking for. % data from posted matlab.mat files f = readmatr...

plus de 5 ans il y a | 4

| A accepté

Réponse apportée
Plotting an amplitude spectrum of a .txt file
This seems to work... % load seismic signal data ss = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_fi...

plus de 5 ans il y a | 1

Réponse apportée
Making two 3D vectors the same length
Given that your question is... How do I pad vector static with zeros at the end so that both vectors are the same dimension?...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
the colors red, blue, yellow repeated again in my plot, how I can give each curve in the plot different color
One way is to specify a different color in each call to the plot function: K=1:30; for i=1:10 C_T=i*log(K); plot_T =...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How to create several figures in a subplot with different axes
You're aren't using subplot correctly. For each plot you need a separate call to subplot with the index (in your case, row) whe...

plus de 5 ans il y a | 0

Réponse apportée
Accessing multiple columns in cell array
You need to retrieve the elements in their underlying data type (hence the use of braces) and concatenate the values using brack...

plus de 5 ans il y a | 0

Réponse apportée
How to store data whose dimension varies at each steps of run?
This is a bit long-winded (and can surely be shortened), but I think it achieves what you are looking for: N = 8; % iterations ...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Find a 4-point polygon enclosing scattered points
No doubt this can be simplified, but I think it meets your objective of finding the vertices (4) enclosing the points: % create...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Don't want box plots to overlap...
You only need to use the boxplot function once. Combine the data in a matrix. You'll get a box plot for each column of data an...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How to disable Matlab verbose mode?
warning off verbose

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Find the indices of the imaginary element of the matrix
% test matrix A=[1 2 3; 4+i 5 6-i; 7 8+i 9] % identify imaginary elements in A (+1 or -1) B = imag(A)...

plus de 5 ans il y a | 0

Réponse apportée
3D surface plot from 3 columns of excel data?
Here you go... T = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/645855/P3%20data.xlsx'); x = T{:,...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Create new matrix containing only subset of values from old matrix
For the matrix multiplication, use squeeze so both matricies are 24x24, then assign the result to the corresponding 1st dimensio...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Average over particular ranges of one dimension in matrix
% test data data = rand(22,40,24,24); % make the 2nd dimension the 1st dimension d1 = permute(data,[2 1 3 4]); % compute...

plus de 5 ans il y a | 0

Réponse apportée
How to place percent of each bar/bin of histogram on histogram chart in the code below?
Instead of histogram, I suggest you use histcounts along with bar: % test data data = rand(1,1000); hc = histcounts(data); ...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
How to do a 2D surface pot as excel graph XY plane isoSAR?
f = figure; f.Color = 'w'; f.Units = 'normalized'; f.Position = [.1 .2 .8 .5]; M1 = readmatrix('https://www.mathworks.com/...

plus de 5 ans il y a | 0

Réponse apportée
Change GridSize of existing non empty TiledChartLayout object
Try using flow for the grid size... tiledlayout('flow'); nexttile; plot([1 2 3],[4 5 6],'-ob'); pause(2); nexttile; pl...

plus de 5 ans il y a | 0

Réponse apportée
how can I save my error term in an array within while loop?
I haven't examined your code in any detail. However, if I understand your question correctly, you simply want to save all the e...

plus de 5 ans il y a | 0

Réponse apportée
I need to fits the attached data as in image
Here's what I put together. This is only for the T5-L5 data. You can repeat this for the rest of the data and build up the plo...

plus de 5 ans il y a | 0

Réponse apportée
What is the matter with this nested looped?
Most likely the problem is with this line for x=n:1 if n > 1, the loop does not execute. Did you mean for x=1:n

plus de 5 ans il y a | 0

Réponse apportée
Random sample, I want the 5% of the data per each hour
There might be a way to simplify this, but I believe the script below achieves what you are after... % read all the data into a...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Sort Columns by ascending order while maintaing cell values in place for every row
Hmmm, I think this works... for k =1:100 %For however many trials (100 in this case) p(:,k)= randperm(32); %Create a perm...

plus de 5 ans il y a | 0

Réponse apportée
Help in plot while plotting a time step response.
A simple solution is just to concatenate the last point from one set of vectors with the subsequent set: t_1 = [t_0(end) t_1]; ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Excel Sheet Sorting and Data Analysis
Assuming the data for the names, grades, and favorite colors are in columns 1, 2, and 3, respectively, then the following code o...

plus de 5 ans il y a | 0

| A accepté

Charger plus