Answered
How can I change the interval on the y-axis?
Here's some example code on how to control the "ticks": x = 1:5; y = randi(100, 1, 5); plot(x,y); set(gca, 'ylim', [0 100]...

2 maanden ago | 0

| accepted

Answered
How to put the marker data over the curve fitting line?
You posted your reply comment as an answer. Oops. But, I see your point. And I'll try to explain here as an answer (although ...

2 maanden ago | 0

Answered
How can I transform these data into seasonal data?
Note: Code in comment moved here... load('DATI_MAR_mensili'); % NOTE: loads a table with 'Year' and 'Month' columns % add...

2 maanden ago | 0

| accepted

Answered
How to Calculate Area Between a Curve and Two Lines?
At the end of your code, add... x = D_Curve_PD_KPe; y = D_Curve_PD_KDe; cropLogical = x > 0; x = x(cropLogical); y = y(cr...

2 maanden ago | 0

| accepted

Answered
How can I store the value of variable 'dist_5thwheel_to_second_axle_sem2_itr' in array/vector format with every for loop iteration such that previous value stays as well? ?
You've got a bug in the setup of your loops. For the inner loop, change for i2 = 1:counter1 to for i2 = 1:counter2...

2 maanden ago | 0

| accepted

Answered
Function that checks for particular key press?
You seem to be using a custom toolbox that I don't have. However, assuming you can use built-in MATLAB functions, the tic and t...

2 maanden ago | 0

Answered
How to create column headers?
Something like this will work. I'm only showing the inner for-loop. fprintf('%6s%6s\n\n', 'x', 'y'); for n=1:length...

2 maanden ago | 1

| accepted

Answered
how to find area under curve for every 10msec?
Here's solution that shows the slope (derivative) and area (integral) sample-to-sample in the signal. The sample period is 10 m...

2 maanden ago | 0

| accepted

Answered
How to have a just specific part of a plot?
Follow the plot command with... axis([0 400 0 120]); axis off; set(gcf,'color','w'); Output:

2 maanden ago | 0

| accepted

Answered
Add legend to plot colored by colormap function
One approach is to do three scatters, one for each value in the 3rd column in your data. Here's the general idea using a modifi...

3 maanden ago | 0

Answered
How can I transform these data into seasonal data?
@Pul. Here's a solution that allows you to get summary statistics by season: load('testdata.mat'); % loads giulia_TT timetable...

3 maanden ago | 0

| accepted

Answered
How can I subtract the times without considering the date in question?
Here's one way to do this: % test data (one month in 30-min increments) dt = datetime(2021,4,1):minutes(30):datetime(2021,5,1)...

3 maanden ago | 0

Answered
How to plot multiple lines with gray color
Here's one way to do this: p=rand(12,5); figure (2) plot(p, 'color', [.5 .5 .5], 'linewidth', 1.5); % gray lines % put tex...

3 maanden ago | 0

| accepted

Answered
Convert final grade letter into categorical array.
% test data containing student letter grades C = { 'A' 'C' 'D' 'A' 'D' 'B' 'B' 'C' 'A' }; % define C to be categorical C = ...

3 maanden ago | 0

Answered
how can a make a loop for a double value in Matlab?
It's not clear what 19 variables you have in the table T1, but I suspect your error will disappear via... for i = 1:length(ID) ...

3 maanden ago | 0

Answered
How to detect negative number in Switch and case statement
Look carefully. Because you are switching on error, your first case expression reduces to error == (error < 0 && Uz > 0) ...

3 maanden ago | 0

| accepted

Answered
How to replace ones and zeros in a logical vector with vectors of corresponding length?
idx = [1 0 0 1 1 0 0]; % appearance of logical index a = [2 3 4]; % the values of a have to replace the ones in indx ...

3 maanden ago | 0

| accepted

Answered
How to convert an array of exponential numbers to am array of whole numbers?
Your question has nothing to do with "converting" numbers. Your question pertains to how numeric values are presented on the di...

3 maanden ago | 0

| accepted

Answered
Can I save different variables inside of a for loop?
Create the desired name of the file as a string or character variable, then use that variable with the save command. For exampl...

3 maanden ago | 0

| accepted

Answered
I want my graph to be continuous
You need to determine the point where the two functions intersect and then use that point in line 6 as the transition between th...

3 maanden ago | 0

Answered
Operator '==' is not supported for operands of type 'table'.
Try this: TurbineTest1=A(strcmp(A.SAPID,u(1,1)),:);

3 maanden ago | 1

| accepted

Answered
Create a timetable for every minute in one day
Here you go. As seen in the output from whos, there are 1441 rows in the timetable, one for each minute in the day plus the fir...

3 maanden ago | 0

Answered
Plotting two Spherical helix on top of each other with one being 90 deg shifted rotated about the z axis
For a before-and-after comparision, substitute the following for the plot3 line in your code. The z-axis rotation isn't particu...

3 maanden ago | 0

| accepted

Answered
Could anyone help me how to calculate the mean of cell array
I'm guessing either m1 or m2 below is what you are looking for. c = { [1 2]; [1 2]; [1 2]; [1 2]; [1 2]; [1 2]; [1 2]; [1 2]; [...

3 maanden ago | 0

Answered
replace specific commas using strrep
In stages, to show the possibilities... s1 = '[[0, 145, 0], [145, 169, 1], [169, 1693, 3], [1693, 1708, 1], [1708, 2729, 3], [2...

3 maanden ago | 0

| accepted

Answered
How to join two datetime table datasets with closest times paired?
TT1 = table2timetable(Dataset1); % 1st data set table with datetime column TT2 = table2timetable(Dataset2); % 2nd data set tab...

3 maanden ago | 0

| accepted

Answered
Get peak values from a Surface mesh figure?
Here's a solution that does not use findpeaks (since you do not have the Signal Processing Toolbox). Below, I am using MATLAB's...

3 maanden ago | 1

| accepted

Answered
2 x 2 mixed ANOVA
It makes no sense to use multcompare here since there are only two "sessions" and only two "groups". multcompare is used when t...

3 maanden ago | 0

Answered
How to synchronize signals at different frequency in the same table
A1 = table2timetable(A); B1 = table2timetable(B); C1 = table2timetable(C); TT = synchronize(A1, B1, C1);

3 maanden ago | 0

| accepted

Answered
How to calculate the area under the curve with data given on an excel file, and not using the function "trapz"?
f = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/702117/Steel6150Tens.csv'; T = readtable(f); T(end,:) = []...

3 maanden ago | 1

| accepted

Load more