Answered
Problem solving ODE system in Simulink
I think something went wrong, when you solved numeric: syms y(t) eq = diff(y,t,4) + 3 * diff(y,t,2) - sin(t) * diff(y,t,1) + 8...

5 years ago | 0

| accepted

Answered
Plotting ODEs with changing variable
tspan = [0,15]; Conversion = [0]; [TH, X] = ode45(@odefun5,tspan,Conversion); figure plot(TH,X) xlabel('Theta') ylabel('Co...

5 years ago | 1

Answered
Add text to all rows of one column in matrix
Use a table: A = [0, 1, 0.94; 0, 2, 0.88; 0, 3, 0.45; 0, 4, 0.66] b = 'C50D' A1 = table(repmat(b,size(A,1),1),A(:,2),A(:,3)...

5 years ago | 0

Answered
Non linear pendulum code
You mixed up the functions and the calling code. Also there is no function for pend_n - to build a working code i just copied th...

5 years ago | 0

| accepted

Answered
how to curve fit to find a value
% Define or load your data for t and I here: % t = ... % I =... % define constants R= .6; C = 270E-12; V = 100E3; % g...

5 years ago | 0

Answered
how to take the average of 6th 7th and 8th value of a 12x1 matrix and it will continue upto 492x1 matrix
Consider A is your 492x1 matrix: B = reshape(A,12,[]); MyMean = mean(B(6:8,:))

5 years ago | 0

Answered
Iterating through columns of data
% Example data U_I_data = [10 0.5; 20 2; 25 4; 12 3; 18.5 2] % R = U/I as an elementwise matlab operation R = U_I_data(:,1)...

5 years ago | 1

Answered
having problems troubleshooting this code (vertcat syntax)
function [r] = quadratic(~) q_fields = {'Coefficient "a"',... 'Coefficient "b"',... 'Coefficient "c"'}; ...

5 years ago | 0

Answered
mean of 6TH, 7TH AND 8TH numbers of every column
myMean = mean(A(6:8,:))

5 years ago | 0

| accepted

Answered
plot the system of three equations
% Given syms theta W_A=100; m_A=W_A/32.2; W_B=20; m_B=W_B/32.2; L=15; theta_0=deg2rad(70); % Solve the system of ...

5 years ago | 0

Answered
How get adjacency matrix from this code
I would recommend to use the inbuilt functions for working with graphs - it makes life much easier: N = input('no. of Nodes'); ...

5 years ago | 0

Answered
Function not returning the desired structure
You dont assign the output of the function to a variable - use: kepler = loadkepler...

5 years ago | 0

| accepted

Answered
Error using vertcat Dimensions of arrays being concatenated are not consistent.
f=[dXadt'; dXbdt'; dXcdt'; dXddt'; dXedt; dXfdt; dXgdt]

5 years ago | 0

Answered
making a up down ramp
I think you can do the rest by yourself: t = [0:0.001:5];% y = zeros(1, length(t));% index_1 = find(t>0.5 & t<1);% index_2 =...

5 years ago | 0

| accepted

Answered
How to robustly find the pupil on an image automatically?
Using the imfindcircles function and giving some additional informations by using the options could help - play with sensitivity...

5 years ago | 0

| accepted

Answered
How can I plot random circles that don't overlap
This might be useful: https://de.mathworks.com/matlabcentral/answers/484453-matrix-indexing-in-a-function

5 years ago | 0

Answered
Using ode45() to find c when t is from 0 to 10 seconds.
k = 0.9; dcdt = @(t,c) -k*c.^2; %function c0 = [1 2 3 6 8 10]; %initial conditions t = [0 10]; % t is from 0 to 10 seconds f...

5 years ago | 0

| accepted

Answered
Problem Solving Kinematic ODE with Forcing Function
Define your external force vector as an additional input argument for your ode system. Inside the odeBuoy function use the <http...

5 years ago | 1

Answered
How do I use ODE 45 to solve for the motion of a baton without structures?
[~, ~, L, ~]= constants; tspan = linspace(0,4,25); y0 = [0; 4; L; 20; -pi/2; 2]; [t,y] = ode45(@dydt_baton,tspan,y0); plot(t...

5 years ago | 1

| accepted

Answered
how i can receive the license number
in command window type: ver

5 years ago | 0

Answered
How to write code for a function x(t), consist of two sine wave with instantaneous frequencies at different time spot as seen in figure below:
syms t y = piecewise((0<t)&(t<=2), sin(2*pi*5*t), (2<t)&(t<=5), sin(2*pi*40*t)) fplot(y)

5 years ago | 0

| accepted

Answered
simple code error, help me please
v = 0:3; w = sqrt(2*11.9*(8.85*10^-14)*((10^16)+(10^18))*(0.817+v)./((1.6*10^-19)*(10^16)*(10^18))); c = ((40*10^-4)*(0.6*10^-...

5 years ago | 0

| accepted

Answered
Curve detection using matlab
here is an approach with only using Matlab basic functions: % Open image file I = imread('image.jpeg'); % Use Green channel...

5 years ago | 0

| accepted

Answered
Vectors must be the same length.
You overwrite X: A=[2,1;2,-1] B=[1;7] d=det(A) X=inv(A)*B A*X %X=-2:0.5:2; Y1=(-2*A+1)/1; Y2=(-2*A+7)/(-1); plot(X,Y1,X...

5 years ago | 0

| accepted

Answered
Solving a function with fsolve
VaR_NE = fsolve(@NEcdf,0) function fx = NEcdf(x) alpha_VaR=0.99; hetta_RL=-0.0047; omega_RL=0.0077; delta_RL=0.0041; fx ...

5 years ago | 0

Answered
Solving a symbolic system of equations
Try: % Equillateral Strain Rosette Problem % angle values (A = 0, B = 120; C =60; seems to be standard for a 60 degree % eq...

5 years ago | 1

| accepted

Answered
Why should I use the zeros function?
It is for performance reasons: https://de.mathworks.com/help/matlab/matlab_prog/preallocating-arrays.html

5 years ago | 1

Answered
Input arguments error on line 2
Divide your code into a function for your ode and the part for solving and plottting the results: y0 = 0; % --> change to 1 for...

5 years ago | 0

| accepted

Answered
what is wrong?
Typo - it is cos instead of cox, and the usage of '.*' elementwise multiplication x=-3:0.1:3 y=sin(x).*cos(2*x)+1 plot(x,y)

5 years ago | 0

Answered
Differentiation for relative sensitivity calculation
D_xN = diff(xN,Nd)

5 years ago | 0

Load more