Answered
4D matrix manipulation
I am not certain what you want. Try this: G = rand(365,31,24,91); % Create ‘G’ Gnew = reshape(...

7 years ago | 0

Answered
convert cell to integer
If ‘kar’ is initially: kar = {{[3]}}; try this: n = cell2mat(kar{:}) producing: n = 3

7 years ago | 2

Answered
Regression on multi-variable data
This is a linear problem, so a linear solution will work. Try this: M = [1.48 1 0.9 0.69 0]; x = [8.526 5.6 6.9654 7 0]; ...

7 years ago | 0

Answered
How can I include a superscript in my x-label
The easiest approach is likely to use semilogx (or if appropriate, loglog) to plot your data. EDIT — I am not sure what tic...

7 years ago | 0

Answered
Error showing "Undefined function 'vecline' for input arguments of type 'sym'."
You misspelled it in your call to it. You defined it as: function vectline(f,crdaxis,crdrange,step) however you called it ...

7 years ago | 1

Answered
How do I convert a .wav file to a .matlab file using wavread?
The wavread function was deprecated a while ago. Use the audioread function (R2012b and later versions) instead.

7 years ago | 0

Answered
How do I convert a .wav file to a .matlab file using wavread?
The wavread function was deprecated a while ago. Use the audioread function (R2012b and later versions) instead.

7 years ago | 0

Answered
How to plot below function f
This is how I would do it: f = @(x) (x/4).*((x > 0) & (x < 1)) + (x/3).*(x >= 1); t = linspace(-5, 5); figure plot(t, f(t...

7 years ago | 0

| accepted

Answered
Contourf plot of datasets
You might find the griddata function useful. It takes random (x,y) values and interpolates gridded z-matrices from them that co...

7 years ago | 1

| accepted

Answered
Phase spectrum without knowing frequency
The lower trace appears to be the negative derivative of the upper trace. So integrating the negative of the lower trace and ...

7 years ago | 1

| accepted

Answered
How to detect a column which gives me maximum value of the result.
Try this: x = rand(15); % Create Matrix y = rand(15,1); % C...

7 years ago | 1

Answered
Error using xlsread (line 257) Excel Worksheet could not be activated
The problem does not appear to be the Excel file, if you can read it correctly in R2017a. See if using the readmatrix function ...

7 years ago | 1

Answered
How do I convert a string to a date?
I am not certain if the numbers are themselves strings, or numbers. If they are numbers, this works: numdate = [20030930230...

7 years ago | 0

| accepted

Answered
How to create a filter with Hz and coefficient?
A filter with 8000 coefficients is likely an FIR filter. For a simple bandpass or bandstop application, an IIR elliptical filte...

7 years ago | 0

Answered
Error: Index in position 2 exceeds array bounds
I recognised my code, so I went back and looked this up. (Reference: Error: Index in position 1 exceeds array bounds.) Your ...

7 years ago | 1

| accepted

Answered
finding peak to draw a smooth curve
Try this: x = 0:10; % Create Data y = rand(1,11); ...

7 years ago | 2

| accepted

Answered
Build a matrix using an equation with known boundary values
I’m not certain what you want to do, however the MATLAB linspace function is probably the way to get there. Example — v = l...

7 years ago | 0

| accepted

Answered
How to Subtract and Add across columns in Matlab?
In the documentation for diff, see Differences Between Matrix Columns. You need to specify the dimension. EDIT — With resp...

7 years ago | 0

| accepted

Answered
Cummulation in the rows
Try this: X = randi(9, 234, 1E+4); % Create Matrix for k = 1:size(X,1) sd(k,:) = std(...

7 years ago | 0

| accepted

Answered
How can I solve the non linear algebraic equation system with a parameter
You can use the matlabFunction function to create an anonymous function from ‘F’ so you can use it with fsolve. However, you st...

7 years ago | 0

| accepted

Answered
Plotting a frequency spectrum for an Impulse Response
Since the impulse has a uniform spectrum equal to unity, the impulse response of a system (control system, filter, etc.) is gene...

7 years ago | 0

Answered
How can I get a voltage vs time plot from a wav file?
You would necessarily have to assume the units are voltage. With that assumption, they are the same. However, audio files (at ...

7 years ago | 0

Answered
datetime Invalid Parameter for TimeZone
You need to put the format string just after the 'InputFormat' name (they are ‘name-value pair’ arguments), and also use the 'Z'...

7 years ago | 2

| accepted

Answered
Repeat numbers of X based on Y to produce Z
Use the repelem function (R2015a and later): Z = repelem(X, Y) producing: Z = 1 1 1 2 3 ...

7 years ago | 0

| accepted

Answered
MIRtoolbox installation. Cannot use functions
‘I've recently downloaded MirToolbox and installed it by moving the main MIRtoolbox folder into the toolbox MATLAB folder.’ You...

7 years ago | 1

| accepted

Answered
calculate normalised frequency of the below plot
‘convert normalised frequency(0.03) into frequncy(hz)?’ Multiply the normalised frequency by the Nyquist frequency. The...

7 years ago | 0

| accepted

Answered
Demo of bode plot
Re-name your ‘norm’ function to something that does not conflict with the name of any MATLAB function.

7 years ago | 0

| accepted

Answered
Subtracting in matrix, column to column (Basic MatLab)?
Your idea is essentially correct. I have no idea what the question wants. Perhaps providing a matrix and a reference to it w...

7 years ago | 0

| accepted

Answered
How to find specific frequency in signal
If you have R2018a or later and the Signal Processing Toolbox, use the bandpass function to filter your signal.

7 years ago | 0

| accepted

Answered
Symbolic toolbox with complex exponentials
One approach is to use the rewrite and simplify functions: syms t y = exp(t*(4 - 2i))/2 + exp(t*(4 + 2i))/2 Y = simplify(re...

7 years ago | 1

| accepted

Load more