Community Profile

photo

Scott MacKenzie


York University

Last seen: Today Active since 2020

Statistics

  • 3 Month Streak
  • Knowledgeable Level 4
  • Pro
  • Revival Level 2
  • First Answer
  • Thankful Level 1

View badges

Content Feed

View by

Answered
How to search closest coordinate values in a Lat Long Z data
You can do this with the pdist2 function. For latitude and longitude, usually the haversine method is used. Google it if you w...

etwa 6 Stunden ago | 0

Answered
Using writetable in a for loop to create new txt/csv files for each step
Under the assumption your code is working fine except for the filename issue, here's what I suggest. Use this to create a new f...

etwa 8 Stunden ago | 0

Question


Problem using ranova for analysis of variance
I'm trying to use ranova to analyse data from a fairly simple experiment, but am not successful as yet. The data (60x3) are att...

ein Tag ago | 0 answers | 0

0

answers

Answered
sorting a matrix of 4 rows by the fourth element and outputting of combinations that make the 4th row element
At the end of your code, add sortrows(combs,4)

ein Tag ago | 0

Answered
How do I center my time-history plot at zero using code
Is the offset you are subtracting the mean of the values in the corresponding arrays? If so, just subtract the means: plot(t,x...

2 Tage ago | 0

| accepted

Answered
Find values in 3D matrix with given indices
Unless I'm missing something, this is just a simple matter of finding the indices corresponding to the latitude 77:81 elements a...

3 Tage ago | 0

Answered
Number of registered results by the number of total experiments in a pie chart
Here's one way to make the labels you want: % test data hEQ = [5 1 1 1 1 1]; % create labels for pie chart total = sum(hEQ...

3 Tage ago | 1

| accepted

Answered
How can I add confidence bounds to the plot?
Seems you are working with a linear model. Also, your attached plot is quite cluttered. It will get worse if you add confide...

4 Tage ago | 0

| accepted

Answered
Filter table based on time and make calculation
You don't need a loop. At a high level, here's what you need to do. Read the data into MATLAB, probably into a table using the...

4 Tage ago | 0

| accepted

Answered
Arrange the matrix by replace a part to another part
Assuming your matrices are conveniently sized... A1=ones(12); A2=ones(9)*2; A3=ones(6)*3; A4=ones(3)*4; A = A1; A(4:end,...

4 Tage ago | 0

| accepted

Answered
How to highlight a portion of time series on a plot?
Here's what I put together. I'm assuming you want 64 separate plots. % test data (timeseries) nRow = 64; % adjust as per yo...

4 Tage ago | 0

| accepted

Answered
Easiest way to load structure array from a text file
To save the data in the structure C in a file... save('savedata.mat', 'C'); To retrieve the data as a structure C later... lo...

7 Tage ago | 0

Answered
read 2 digits in a txt file using %f
If you examine the documentation for fscanf, it states that the correct formatSpec to use when reading floating-point numbers is...

8 Tage ago | 0

Answered
How to end loop after key is press
Here's an arrangement I've used with good success in the past. The loop executes indefinitely until a key is pressed. f = fi...

8 Tage ago | 0

| accepted

Answered
How to find the noisy signal using fourier transform for this data?
Here's what I put together. The input signal is somewhat noisy, but it is also periodic @ 34.4 Hz. f = 'https://www.mathworks...

9 Tage ago | 0

Answered
Save number of iterations in a for loop
@Rajvi AmleThis script shows one approach to plotting the results of your simulations. The data loaded are the t and x data col...

9 Tage ago | 0

Answered
how can i plot the amplitude spectrum of these signals
Do you want the FFT of the combination of the 20 Hz and 50 Hz signals? If so, then this might be the sort of plot you are after...

11 Tage ago | 0

Answered
How to remove NaN from 2 column vectors?
X = [2 4 8 NaN 13 NaN 3 6 NaN 38 40 11]; Y = [NaN NaN 2 NaN 10 67 1 NaN NaN 19 26 NaN]; nanLogical = isnan(X) | isnan(Y); X(n...

11 Tage ago | 0

| accepted

Answered
start to write for a specified location using fprintf
Here's a solution. Make sure you use "r+" when opening the file, otherwise you'll overwrite the first line. fid = fopen('testd...

11 Tage ago | 0

| accepted

Answered
start to write for a specified location using fprintf
fid = fopen('testdata.txt', 'w'); % change, as needed fprintf(fid, ' result_1 result_2\n'); fprintf(fi...

11 Tage ago | 0

Answered
Removing top and bottom outliers
Yes, the rmoutliers function will do the trick. After removing the top and bottom 5% of the values, the vectors below are reduc...

11 Tage ago | 0

Answered
Split a target date interval into seasons and find the percentile of days for each season
There might be a way to shorten this, but I think it achieves what you are after. You didn't mention the year, so I set this up...

12 Tage ago | 0

| accepted

Answered
Plot of 3D colour scatter graph
I think this is more or less what you're after: f = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/679873/poin...

13 Tage ago | 0

| accepted

Answered
Plot 2D vector field
The reason you aren't seeing any vertical component in the quiver arrows is that the data in the V argument (wi) are very small ...

13 Tage ago | 0

Answered
How to index the values of an array using a series of rows, column indices?
If you want to pull those three values from A and concatenate them, as in your output, then just retrieve the three elements usi...

14 Tage ago | 0

Answered
repeat rows and export to txt file
I think this is more or less what you're after: % test data (read from file) A = [1 8;2 7;3 6;4 5] x = 3; % number of times t...

15 Tage ago | 1

Answered
Extrapolation: How do I extrapolate a curve with minimum error.
Here's what I put together. The extrapolation uses the 4-coefficient model returned by fit in your code: xx = 1:1000:40000; y...

16 Tage ago | 0

Answered
Organizing array of data skipping empty values
I don't think you need nested for-loops. Use the 1st column of the data read as an index into the M.Rexxxx structure to direct ...

16 Tage ago | 0

| accepted

Answered
How to assign corresponding Z value to gridded X,Y data ?
Try replacing interp2 with griddata, like this: [X,Y] = meshgrid(min(lla(:,1)):0.1:max(lla(:,1)), min(lla(:,2)):0.1:max(lla(:,2...

17 Tage ago | 0

| accepted

Load more