photo

Scott MacKenzie


York University

Last seen: 24일 전|2020 이후 활성

Statistics

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

배지보기

Content Feed

보기 기준

답변 있음
Calculating and add the std error bar from the mean values
You can't calculate the standard error from the means. You need the raw data. If the raw data (used to calculate the means) ar...

24일 전 | 0

|수락됨

답변 있음
Separating table data by year
Here's what I put together using random temperatures between 30 and 100 over the period of interest. Since the temperatures are...

29일 전 | 0

질문


R2022a problem: Line number missing in error message sent to Command Window.
With R2022a, line numbers are sometimes omitted in error messages. Here's an example using a trivial script: If I run the sa...

약 1달 전 | 답변 수: 1 | 5

1

답변

답변 있음
I have 2 columns in a matrix. 1st column has the dates. 2nd column has the values. How do I grab all values from 2nd column associated with its date from the 1st column??
这样的工作:测试数据% d = {'4/1/18', 6; '4/2/18', 22; '4/2/18', 4; '4/3/18', 2; '4/3...

약 1달 전 | 1

답변 있음
Set to zero values in matrix in between two lines
You can vectorize the inner loop: % values of the matrix = 0 in between the two lines for ii=1:width A(floor(s1*ii+b1):fl...

약 1달 전 | 0

답변 있음
What is the code to count the number of word in the text file?
There are a few ways to set this up. Here's one using line-by-line processing and a loose definition of a word as a space-delim...

약 1달 전 | 0

답변 있음
how to plot surface graph in matlab?
The surf function is probably what you want: (Note that csvread is "not recommended".) x = 350:390; y = linspace(0.001, 0.03...

약 1달 전 | 1

|수락됨

답변 있음
Repeated measures ANOVA with 2 variables with different levels
Change rm = fitrm(dv, 'uniR - texB ~ 1 ', 'WithinDesign', withinDesign); to rm = fitrm(dv, 'uniR-texB ~ 1 ', 'WithinDesign', ...

약 1달 전 | 0

|수락됨

답변 있음
Dot indexing is not supported for variables of this type
Change xApp = av_train; data=xApp (: , 1); type = 1; feature=featureExtraction(data,'mean',type); to xApp = av_train; dat...

약 2달 전 | 0

|수락됨

답변 있음
Histogram function plots different colours from those requested
The histogram function uses a face alpha of 0.6 by default. That's why the colors appear a bit lighter than the values from your...

약 2달 전 | 1

답변 있음
How to label each line in the plot
The main problem in the image is that the values are superimposed. This can be fixed by using an index into the Values array fo...

약 2달 전 | 0

답변 있음
Finding minimum output value for same inputs in a table
Is your table consistently organized as in the image; i.e., 36 rows repeating with the same values execpt for the last column (f...

약 2달 전 | 0

|수락됨

답변 있음
draw oriented rectangle around a blob
Something like this seems to work: img = imread('testimage.jpg'); bw = imbinarize(im2gray(img),'adaptive','Sensitivity',0.45);...

약 2달 전 | 0

|수락됨

답변 있음
How do I filter a signal, using FIR filters.
You could perhaps use a butterworth bandpass filter: (Note: Requires Signal Processing Toolbox) t = 0:1/8000:1023/8000; w = 0...

약 2달 전 | 1

|수락됨

답변 있음
Duration of generated sound not correct
Change sound(y); to sound(y,Fsam); The sound function assumes a sampling rate of 8192 Hz. If a different sampling rate is u...

약 2달 전 | 0

|수락됨

답변 있음
How do i plot an audio file with an interval in ms?
Using the sample frequency of the audio data (Fs), this code will extract and plot the first 20 ms: [x, Fs] = audioread('AudioS...

2달 전 | 0

|수락됨

답변 있음
Designing a Butterworth Filter
Here's a solution, but it requires MATLAB's Signal Processing Toolbox. Given, sRate, the sample rate of your data, fc, the de...

2달 전 | 1

답변 있음
Find files of a certain extension and populate a structure field with those file names.
Your second command is wrong. The dir command returns a structure. You don't need to append ".file_names". The filenames are ...

2달 전 | 0

|수락됨

답변 있음
How to estimate the Statistical Significance of a Correlation When the Data Are Serially Correlated in matlab?
MATLAB's corrcoef function provides the correlation (r) as well as the significance (p) of the correlation. For your data set, ...

2달 전 | 0

답변 있음
Rearranging tables based on elements
For tables, an effective way to "transpose" (switch rows with columns, including variable names) is using the rows2vars function...

2달 전 | 0

답변 있음
Finding student t critical value...
Here's demo code using tinv to produce the t-critical values for a two-sided test with independent samples (i.e., between-subjec...

2달 전 | 0

답변 있음
How to draw a pulse train
It seems you want to replace the negative portion of the pulse with zeros. Like this, perhaps: fy=100; wy=2*pi*fy; duy=0.02;...

2달 전 | 0

답변 있음
How to generate Pattern in MATLAB
Here's code to generate the patterns in the image posted: f = figure('color', 'w', 'Units','normalized','Position',[.25 .3 .4 ....

2달 전 | 0

답변 있음
How do I make the movmean calculate the moving average at the start- and endpoints of an array but in conjunction to each other?
This seems to do the trick: A = [0 2 4 1 3 5 7]; M = movmean(A,[2 1]); M2 = movmean([A A A],[2 1]); n = numel(A); M2 = M2...

2달 전 | 0

|수락됨

답변 있음
How to rank data and set corresponsing values
Assuming the rankings are just used to explain your final goal, the following seems to work: M1 = [0.004130861 0.001492476 -0...

2달 전 | 0

답변 있음
How can I save the output figure into an image file?
A easy way is to use exportgraphics, introduced in R2020a: f = figure; imshow(...); exportgraphics(f, 'filename.jpg'); % or ....

2달 전 | 0

답변 있음
Generate acoustic signal with difference rise time and fall time
Here's a simple approach that provides separate control for the rise or attack time (n1), the sustain time (n2), and the decay o...

2달 전 | 0

|수락됨

답변 있음
Store identical rows in specified column
This seems to answer your question. There are 41 uniques IDs in the second column of your data set. The code below extracts th...

2달 전 | 0

|수락됨

답변 있음
Save marked point on plot
OK, this seems to to work. The x-y coordinates of the marked points are output to the command window (along with the figure num...

2달 전 | 0

|수락됨

답변 있음
Save marked point on plot
Since you haven't provided any data or code, this is a rough answer only: [pks, locn] = findpeaks(-y, 'MinPeakProminence', 0.1)...

2달 전 | 0

더로드