Réponse apportée
How do I trim a WAV file from point A to B.
You have the sampling frequency as an output from the audioread function. The time vector would typically go t = 0:1/fs:(length...

plus de 6 ans il y a | 0

Réponse apportée
Change axis from time to frequency
y is not a time series. Hz are not a unit of time. You cannot express something in the frequency domain as a function of time, b...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Array indices must be positive integers or logical values.
Here is a minimal working example of your problem x = rand(1,15); ind = 2*0.14/0.02+1; % occurs when s = 8 x(ind) Error: Ar...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
A switch case statement that will help me to either run codeS in Windows or linux, based on whichever OS it is
if ismac % Code to run on Mac platform elseif isunix % Code to run on Linux platform elseif ispc % Code to run ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Improve performance on finding max values of matrix
clearvars; % create fake data [y,x] = meshgrid(1:5); data = [rand(size(x(:))).*x(:),y(:)].*2; % different values of x (1st ...

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
Ploting Rayleigh faded signal copies
figure plot(t,real(sin1)) hold on plot(t,imag(sin1)) xlabel('Time') Or, using subplot figure subplot(2,1,1) plot(t,real(...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
is it possible to convert iddata to cellstr
Close, but you need to access the *contents* of the cell array, not the entire cell array itself. data.y(:,1) = {rand(500,...

plus de 6 ans il y a | 0

Réponse apportée
grouping numbers in matrix
This is not a generalized solution, and assumes that there will always be three entries of each number (1, 2, 3) in A. [~,s...

plus de 6 ans il y a | 0

Réponse apportée
Hilbert transform with sine and cosine
The hilbert transform, as per the documentation, indicates that the imaginary part of the transform is the original (real) seque...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
delete dimension based on user input
This should work. a = rand(4,3,2,5); % random 4D matrix dim = 3; % let's remove 3rd dimension numDims = 1:length(size(a)); % ...

plus de 6 ans il y a | 1

Réponse apportée
Outliers in a dataset
If x is also size 50x2, then you should pick a column to index as well. mx1_1 = mean(x(R1,1)); mx1_2 = mean(x(R1,2));

plus de 6 ans il y a | 0

Réponse apportée
How to change the color of the most recent plot point?
Consider the following idea: N = 10; cmap = parula(N); figure for n = 1:N plot(n,n,'o','Color',cmap(n,:)) ...

plus de 6 ans il y a | 0

Réponse apportée
I want to know how to speed up my for loop,it's a simple for loop.thanks
You don't need to do this in a loop at all. Here is how to vectorize the creation of the indices from 1:103, ..., 410:512. From ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Undefined function or variable 'PrintSpaceTrussNodeCoordinate' error
Wherever you found this code, you need to download the associated functions with it. (Which I also said on the other question yo...

plus de 6 ans il y a | 0

Réponse apportée
Problems when creating matrix
The results are equal up to double precision. Look at this: max(abs(categ1-categ2)) % ans = % 2.22044604925031e-16 eps ...

plus de 6 ans il y a | 0

Réponse apportée
signal processing (segmentation )
If you want them sequentially, just put them back together using combinedSignal = [sig1 sig2 sig3]; % etc... sigN

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Finding max amplitude from cosine
The maximum amplitude of F(t) = A*cos(w*t) where A = 1, will always be 1, for all values of w. This doesn't require use of ...

plus de 6 ans il y a | 0

Réponse apportée
vectors must be at the same length error
You are concatenating x and y into a doubly long vector. If you want to plot both signals, do plot(t,x,t,y)

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Index 2D matrix along line rotated about the matrix midpoint
Here is another idea, perhaps you can play with it. You'll have to implement this in a loop. [cx,cy,c] = improfile(I,xi,yi,...

plus de 6 ans il y a | 0

Réponse apportée
display file function crash
try % some code here x = 1:5; for n = 0:4 y = x(n); % can't access x at position zero! end cat...

plus de 6 ans il y a | 0

Réponse apportée
What is the origin of this bus error?
Seems like you are running too many processes and ran out of memory. I've had this happen before and I just needed to limit my p...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Can only choose pi radians / sample in Passband frequency, not Hz.
_This toolbox uses the convention that unit frequency is the Nyquist frequency, defined as half the sampling frequency. The cuto...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Cell to 3D Matrix
mycell = repmat({rand(360,900)},20,1); % this is what you currently have mat3D = permute(cat(3,mycell{:}),[2 3 1]); ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Creating multiple polar plot graphs for different frequencies
I'm writing the same thing here so this question can be answered. The issue is you are overwriting your variable f when you w...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How to overlay a plot onto a scatter plot?
You cannot plot vectors of different size. whos x y xtrue ytrue You'll see that x and y are 300x1, xtrue is 1x10001, an...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
overlay mask on sequence of mri images to mark out tumor ROI
maskedImg = imgArray.*segment_mask; % segment_mask is size [256,256] % maskedImg is same size as imgArray [256, 25...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Simulink error: The data abscissae must be distinct and strictly monotonic.
None of the variables in the matfile are monotonic. all(sign(diff(Tga))==1) % ans = 0 all(sign(diff(Tm1))==1) % ans = 0 all(s...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How do I make heatmap axes order from bottom-top?
x = magic(10); figure imagesc(x) % notice the y-axis goes from 10-1 from bottom to top set(gca,'YDir','normal') % now it is r...

plus de 6 ans il y a | 0

Réponse apportée
Could anyone suggest me is there any way of choosing maximum and minimum values together
A = [23 42 37 18 52]; minmaxVals = prctile(A,[0 100]) ans = 18 52

plus de 6 ans il y a | 0

Réponse apportée
Generate a random signal in Matlab
y = (rand(10000,1) > 0.5)*2 -1;

plus de 6 ans il y a | 1

| A accepté

Charger plus