Answered
Problem using biquad filter object
Even better, I would use filtfilt function in order to have zero lag: clc;clear all; Fs=44100; Ts=1/Fs; t=0:Ts:0.2;% to beete...

3 years ago | 0

Answered
Plot structure in 3D coordinate
This slight modification is to get you going into right direction. function[structplot] = plotstruct(coord, ends) %input: ...

3 years ago | 1

| accepted

Answered
Accumulating values for different people
Let's say you have an input data file named 'inputData.txt' with the following structure: $12,00 Josh $27,00 Sophie $18,00 Je...

3 years ago | 0

Answered
filling a matrix with outcomes of a for loop
Is this something you're looking for? N = 10; R = zeros(4,1); D = zeros(4,N); for n = 1:N R = normrnd(40,7,[4,1]); ...

3 years ago | 1

| accepted

Answered
Energy and Power of a Piecewise Function
This is how I would do it and how it seems natural to me. It doesn't make sense to perform integration based on theoretical defi...

3 years ago | 0

Answered
Determine -3db gain on Freq- gain plot
I think this code can help you, it is something I often use. It is not most efficient, but it works. Please have a look at the ...

3 years ago | 0

Answered
Battery nominal capacity estimation using Coulomb Counting
Hello Mateo, I don't think there is a problem in your code. It seems that you used correct way to perform numerical integration...

3 years ago | 0

| accepted

Answered
Battery nominal capacity estimation using Coulomb Counting
Try to add the following line immediately before lsqnonlin call rng default I cannot test it myself, because your function use...

3 years ago | 0

Answered
Good afternoon, I am receiving errors in MATLAB when plotting and I cannot figure out seeing what is wrong with my code
Use normal arrays and not cell. % either this plot(cell2mat(x_coordinates), cell2mat(y_coordinates)); % or x_coordinates ...

3 years ago | 0

Answered
Filter() command is not passing through sine wave
You do understand that "input = sin(2*pi*1000*n/48000) (n equals 1 for this set of variables) " means input is not sine wave b...

3 years ago | 0

Answered
How to code integral of product of lognormal variables?
Please have a look at how this example would be solved in Matlab: syms x y z; f = @(x,y,z) 2*x.*exp(y).*sin(z); % define the...

3 years ago | 0

Answered
why do i get this error as no enough input arguments
You're probably executing this code as a Matlab script. You need to make a function call. This code should be saved in a separa...

3 years ago | 0

Answered
Generating a square mesh
If you look at the examples in the Matlab documentation for the mesh function, you can find something like this: [X,Y] = meshgr...

3 years ago | 0

| accepted

Answered
Error in line 12. I cant use 'inline' command. How to fix it? There are 3 iterations. Equation is f(x)= e^-x-x and the derivative is -e^-x-1. Using Newton Raphson Method
Try this: format short clear clc syms x % Write the function here % f= @ (x) exp(1)^-x-x; f = @ (x) exp(1)^-x-x; df = d...

3 years ago | 0

Answered
Adjust the Motion Speed of animate Option in ezplot3
ezplot3 is not recommended function to use in Matlab any more. There are other, maybe not that elegant ways of making animatio...

3 years ago | 0

| accepted

Answered
How can I add a space below the title?
If you need to add space below your title, you can add newline, something like this: title(['T (^oC),' ' Time = ',num2str(times...

3 years ago | 0

Answered
Exceed array bound at position 2
This is your problem: for i = 1:cols for j = 1:rows m01 = m01 + j * Iin(i,j) / 255; end en...

3 years ago | 0

| accepted

Answered
Error during integration after differentiation
Perhaps, this is what you asked for: f = @(x,y,z) x.*y.^3.*z.^3; % define the input function syms x; g = diff(f,x); % use ev...

3 years ago | 0

Answered
How to take the average every 4 data points?
Just in case if you want to calculate mean/average of the elements in the last chunk (partition) that contains less that 4 eleme...

3 years ago | 1

Answered
Arrange clustered rows based on their label value
Hello Elysi, maybe I'm missing something here, but according to your code, you partition input data into 8 clusters, but your Y...

3 years ago | 0

| accepted

Answered
What is wrong with my code?
Execute command: [r,c] = size(hammer_data16) To see actual dimensions of the matrix hammer_data16 and then you'll see where th...

3 years ago | 0

Answered
about psd estimation by FFT
It is because of Parseval's theorem, which expresses the energy of a signal in time-domain in terms of the average energy in its...

3 years ago | 0

| accepted

Answered
step signal at specific time
You might want something like this: value = 0.8; occ_points = [0.2, 0.5, 0.7, 1.3]; t = 0:0.01:2; y = value * ones(size(t));...

3 years ago | 1

Answered
Understanding the train/validation and test set.
Hello Bob, I don't think that anyone could explain this better than Andrew Ng himself. Please have a look at this YT video: ht...

3 years ago | 1

| accepted

Answered
Why the regexp returns wrong result?
Because you have a match, for example, for the first element: X2300IF_S1 Did you perhaps want: '^X.*2$' so that 2 must be...

3 years ago | 1

Answered
how to do coordinate transformation around a fixed axis using robotics toolbox or spatial math toolbox?
Hello Daniel, I suggest you to look in the book "Modern Robotics" by K. Lynch and F. Park, which is available online for free. ...

3 years ago | 0

| accepted

Answered
Cannot get the plot to work
Please use " toggle code" option when posting Malab code. It looks better. The reason you're not getting what you expect is tha...

3 years ago | 0

Answered
Please this code says Error using plot. Vectors must be the same length. Error in untitled2 (line 8) plot(I,V,'0');
It is because I has 11 elements and V has only 10 elements. Thy should have the same number of elements to plot them as (x,y) pa...

3 years ago | 0

Answered
I know a car's starting speed and deceleration rate. How can I calculate the stopping time in the code?
Well, your deceleration rate is not constant and what I see from the code it starts with -0.4237 m/s^2 and ends with -0.3 m/s^2,...

3 years ago | 1

| accepted

Answered
How can I fix "Index in position 2 exceeds array bounds" in for loop ?
This is because you're not using length correctly. In fact it is not a good idea to use length when working with matrices. In y...

3 years ago | 0

Load more