Respondida
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 ?...

más de 5 años hace | 2

| aceptada

Respondida
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...

más de 5 años hace | 1

| aceptada

Respondida
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...

más de 5 años hace | 0

| aceptada

Respondida
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...

más de 5 años hace | 0

| aceptada

Respondida
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...

más de 5 años hace | 0

Respondida
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...

más de 5 años hace | 0

| aceptada

Respondida
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...

más de 5 años hace | 3

| aceptada

Respondida
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...

más de 5 años hace | 0

Respondida
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 ...

más de 5 años hace | 0

Respondida
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 ...

más de 5 años hace | 0

| aceptada

Respondida
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 ...

más de 5 años hace | 0

| aceptada

Respondida
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...

más de 5 años hace | 0

Respondida
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 ...

más de 5 años hace | 0

Respondida
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 ...

más de 5 años hace | 0

Respondida
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 ...

más de 5 años hace | 0

| aceptada

Respondida
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 ...

más de 5 años hace | 0

Respondida
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...

más de 5 años hace | 0

| aceptada

Respondida
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 ...

más de 5 años hace | 0

Respondida
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...

más de 5 años hace | 0

| aceptada

Respondida
Plotting sequences over intervals
You could do it like this n = -10:10 x = zeros(length(n),1) % preallocate array of zeros to hold result for k = 1:length(n) ...

más de 5 años hace | 1

| aceptada

Respondida
Index in position 2 exceeds array bounds (must not exceed 1). Error in dlmread (line 159) result= result(:,1:ncols);
You may have other problems too, but I noticed that since i does not change inside of your loop, you always read from the same s...

más de 5 años hace | 0

Respondida
optimising variables that are dependent on other variables
If you have the optimization toolbox then you can use fmincon to solve this type of problem. https://www.mathworks.com/help/opti...

más de 5 años hace | 1

| aceptada

Respondida
Why is my plot not showing?
You need to use ./ Other wise you end up with just one value for f,g, and h x=linspace(-2,2,100); f=(3*x)./(9*x.^2+1) % ./ g=...

más de 5 años hace | 1

| aceptada

Respondida
Plotting for specific values
plot(node,U(:,t==0.25),node,U(t==0.5)) % and so on

más de 5 años hace | 0

| aceptada

Respondida
Problem using polyfit with NaN data
To avoid having NaN in polyfit I would use iFit = isfinite(Strain) c = polyfit(Strain(iFit),Load(iFit)) % ok to have NaN w...

más de 5 años hace | 0

| aceptada

Respondida
Solve as Optimization Problem in Matlab
I think you can use the MILP mixed integer linear programming functionality if you have the optimization toolbox https://www.ma...

más de 5 años hace | 0

Respondida
Plot / Solve system for nontrivial answer. dot operator issue?
I don't have the symbolic toolbox, but you can also solve this type of problem using fzero You need to write a little function ...

más de 5 años hace | 1

Respondida
Using an external script/function in simulink "matlab function block"
Will the 1-D interpolation block do what you need? https://www.mathworks.com/help/simulink/slref/1dlookuptable.html

más de 5 años hace | 0

| aceptada

Respondida
My code taking too much time
You can operate on the entire vector using for example a(a<1) = randn So you could make a loop something like while any(a<1) ...

más de 5 años hace | 0

| aceptada

Respondida
How to perform xor operation on an three input binary bits.
The MATLAB function xor takes two input arguments and and provides and xor between the elements of each argument. So for exampl...

más de 5 años hace | 1

Cargar más