Community Profile # Scott MacKenzie

### York University

Last seen: Today Active since 2020

#### Statistics

• • • • • • #### Content Feed

View by

p value for two sets having variable x and y
Since for each system, y is the measured response for x, you can reduce the data for that set to x-y. Also, since the systems u...

2 dagar ago | 0

Question

ranksum function is purportedly the same as the Mann-Whitney U test, but the results differ. Is there a reason why?
I've written a script to implement the Mann-Whitney U non-parametric test. As a guide, I used a data set (attached) and example...

4 dagar ago | 0 answers | 0

### 0

How do you print the F-stat in a multcompare test?
@Darla Bonagura There is no F-statistic for post hoc pairwise comparisons tests such as Bonferonni, Scheffe, and so on. There i...

7 dagar ago | 0

Replacing Empty Cells by NaN
You can use fillmissing and specify the fill value for each column. Obviously, the fill values depend on the data type in the c...

ungefär en månad ago | 0

| accepted

Remove dimension from high dimensional array
Try this... M = rand(10, 8, 10, 8, 6, 7, 8, 9); whos M(:,:,:,:,2:end,:,:,:) = []; N = squeeze(M); whos

ungefär en månad ago | 0

| accepted

Repeat a cumulative sum in a matrix
Here's a way to do this without a loop: % test data (monthly returns for many investments for 252 months) M = rand(2784,252); ...

ungefär en månad ago | 1

| accepted

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]...

ungefär en månad ago | 0

| accepted

How to put the marker data over the curve fitting line?

ungefär en månad ago | 0

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...

ungefär en månad ago | 0

| accepted

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...

ungefär en månad ago | 0

| accepted

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...

ungefär en månad ago | 0

| accepted

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...

ungefär en månad ago | 0

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

ungefär en månad ago | 1

| accepted

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...

ungefär en månad ago | 0

| accepted

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:

ungefär en månad ago | 0

| accepted

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...

ungefär en månad ago | 0

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...

ungefär en månad ago | 0

| accepted

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)...

ungefär 2 månader ago | 0

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...

ungefär 2 månader ago | 0

| accepted

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 = ...

ungefär 2 månader ago | 0

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) ...

ungefär 2 månader ago | 0

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) ...

ungefär 2 månader ago | 0

| accepted

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 ...

ungefär 2 månader ago | 0

| accepted

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...

ungefär 2 månader ago | 0

| accepted

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...

ungefär 2 månader ago | 0

| accepted

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...

ungefär 2 månader ago | 0

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

ungefär 2 månader ago | 1

| accepted

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...

ungefär 2 månader ago | 0