How to combine two tables with measurements taken over the same range but different intervals?
Put the two sets of data into MATLAB timetables, then use the synchronize function to combine them

6 months ago | 0

How can i start my systems response from 1 sec??
In Simulink, go to the Modeling tab, Modeling>Model Settings>Model Settings>Solver This will bring you to the Configuration Par...

6 months ago | 0

| accepted

How do i round to two decimals without zeros at the end
I think this might do what you want fprintf('Dog detected at second %0.2f\n',idx(:))

6 months ago | 0

| accepted

Dot indexing not supportedd
T = xlsread( ) returns an array of double values, not a table so T.xxx is not meaningful I suggest using readtable instead.

6 months ago | 0

Breaking an algebraic loop
I usually put in a delay block with a relatively small value set for the one sample delay to break algebraic loops. If you use a...

6 months ago | 0

How to find X value of given Y close to zero ?
Here's another approach that is maybe more obvious to understand x = [338.00 339.00 340.00 341.00 342.00 343.00] dat...

6 months ago | 0

How to display data from a table using fprintf?
fprintf ('The Maximum Number of Cases Are: %d on %f', X.DAILYCASES,X.DATE)

6 months ago | 0

converting matrix to constant value in matlab function (Simulink)
Try a MATLAB Function block with the following, this worked for me function y = fcn(u,m) y = min(u(u>m));

7 months ago | 0

| accepted

Select a range of rows in Excel
You should be able to use MATLAB's readmatrix function, e.g data = readmatrix('myfile.xlsx','Range','90:233') or if the start ...

7 months ago | 1

Find group number from a range of data that is not fixed
Are your groups always as you show in your example? That is, group 1 = 1,2,..8 group 2 = 9, 10,..16, group 3 = 17,18, ...24 ?...

7 months ago | 2

| accepted

How to design a charging and discharging circuit for my supercapacitor using only Simulink blocks without the simpowersystems
In general to model charging a capacitor in Simulink I would think about it this way. Go back to fundamentals The voltage on a...

7 months ago | 0

| accepted

How to define Estimated Correlation Formula on MATLAB?
You are convolving y with itself and u with itself. You should be able to do this using the MATLAB conv function. You should al...

7 months ago | 0

| accepted

Calculation of a given area using the trapz
You need to limit the range of x and y that are fed to trapz, you could do something like this, assuming your original variables...

7 months ago | 0

| accepted

How to plot e^(-2n)
Assign a vector of equally space values over the range of interest to the variable n Assign a value y to a MATLAB expression th...

7 months ago | 0

Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'.
You need to use .^ for all of your powers. Also ./ for your divide, like this clear clc wn = 150; w = 3.142; wb = 0.50; re...

7 months ago | 0

| accepted

Undefined function 'xline' for input arguments of type 'double'.
Is it possible that the university computer is running an outdated version of MATLAB? According to the documentation xline was i...

7 months ago | 2

| accepted

why is my plot plotting blank?
The reason your plot is blank is because all of your y values are infinite. They are infinite because Cd is zero for all of your...

7 months ago | 0

Numeric integration with Trapezoidal and Simpson's rule
You may have other problems too, but it looks like you clear all of your variables right after you just defined your limits and ...

7 months ago | 0

this is the code that i want to run, but got problem Undefined function or variable 'QFix'
You need to make sure that the directory where the file QFix.m is located is put onto the MATLAB path. Click the Set Path icon ...

7 months ago | 0

| accepted

How to stop the for loop once the right input is given. Cannot use break.
You could loop with a while statement instead. Set the exit condition on the while statement to be that the answer was wrong or ...

7 months ago | 0

| accepted

finding value of matrix in an if statement
I'm not sure exactly what you are trying to do, but I will try to explain what your statement is doing and why it might not be w...

7 months ago | 0

Incorrect Intersection Output of Two Lines
The main difficulty here is comparing Klaus and Hans heights at simultaneous times. Note that the elements of xh and xk are not ...

7 months ago | 0

Only getting zero as my output for ode45
The "problem" is that x0 = 0 is an equilibrium point of your system dx/dt = 0 when x = 0. So if you start the system at x0 = 0 ...

7 months ago | 0

Defining ODE function as function file
Looking briefly at your function definitions, it seems that maybe you are misunderstanding what this function is to compute. It ...

7 months ago | 0

| accepted

Transfer function to low or high pass
One way would be to make a Bode plot of the frequency response and determine does it gain go to zero at high frequencies or low ...

7 months ago | 0

How do I get a loop to calculate for each value of a formula, not just the last n of the input(N)?
You must provide an array to hold your output force. You keep overwriting it with each loop iteration So, depending upon what y...

7 months ago | 0

| accepted

How do I vectorize a nested for loop with different sized steps?
I think you may be able to utilize the filter2 function for this purpose. For example A = [1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 ...

7 months ago | 0

Trying to find a minimum value
You may have some additional problems but one is that you reset wb to zero with every loop iteration, first line in your loop is...

7 months ago | 0

| accepted