Resuelto


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

alrededor de 5 años hace

Resuelto


Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x. <<https://i.imgur.com/jlZDHhq.png>> Image courtesy of <http://up...

alrededor de 5 años hace

Resuelto


Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

alrededor de 5 años hace

Resuelto


Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

alrededor de 5 años hace

Resuelto


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

alrededor de 5 años hace

Resuelto


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

alrededor de 5 años hace

Respondida
linearizing a 2nd order ODE in matlab
Hi, Linearization of the given ODE can be done via Jacobian matrices that need to be derived. Some good appropriate discussi...

alrededor de 5 años hace | 0

| aceptada

Respondida
Why is pagemtimes slower than just coding up the matrix multiplication?
Hi, There is no need to perform this loop calcs that is just a repeatition: tic %for i = 1:20 %% Electric Field Update...

alrededor de 5 años hace | 0

Respondida
How can I create a confusion matrix from a simple fuzzy logic model?
Hi, Here is a nice help documentation by which you can develop *.fis models: https://www.mathworks.com/help/fuzzy/genfis.htm...

alrededor de 5 años hace | 1

| aceptada

Respondida
Fit Curve to a "C" shape
Just a piecewise interpolation can be done in this case, but not fit model calculation: clearvars x = [1 0 -1 0 1]; y = [-1 -...

alrededor de 5 años hace | 0

Respondida
How to save output from equation in for loop into an array
% Range from 0.0 m to 4.00 m using 0.01 m increment t=0.0:0.01:4.00; for ii = 1:numel(t) % Formula for enthalpy from entr...

alrededor de 5 años hace | 0

| aceptada

Respondida
Two different solutions for one differential equation (population model)
Besides k1, in your derivations, there are some errs. Here are the corrected formulation in your derivation part: c1 = 4; c2 =...

alrededor de 5 años hace | 1

| aceptada

Respondida
how i want to generate error indices and time domain specification?
Hi, You can easily compute the errors using the followings: ERR= SP-PV; IAE = trapz(T,abs(ERR)); % trapz=numerica...

alrededor de 5 años hace | 0

Respondida
running of my m-function is very slow
Hi, From the quick scanned imression of your code, the following two points can be proposed. (1) You are using symbolic math ...

alrededor de 5 años hace | 0

| aceptada

Respondida
Lagrange Interpolation related problem (plotting a graph)
Hi The answer is simple: plot(x, L(1,:)) OR plot(x, L(2,:)) plot(x, V) or plot(x, P) Or within the loop: ... if i~= j ...

alrededor de 5 años hace | 0

Respondida
How to use 'layout' in nexttile to make the legend appear in the sixth position in 6 tiled chart?
Hi, Here is a realtively simple solution via an easy example: A = randi([1, 5], 6); p = bar(A); legend(p(1,6),{'6-th tile'...

alrededor de 5 años hace | 0

Respondida
Distance of obstacle from Ego vehicle in Point clouds
Hi Mohammed, This help documentation can provide substantial hints for your exercise: https://www.mathworks.com/help/vision/...

alrededor de 5 años hace | 0

Respondida
animate Double Pendulum with solved ODE.
Hi, Here is an updated and corrected code with a different animation procedure: L2 = 20; t = 0:.1:2*pi; double_pendule(t, L1...

alrededor de 5 años hace | 0

| aceptada

Respondida
compute angles between antennas
Hi, The built in function of matlab to compute the phase angles is angle() It computes the phase angle between real and imag...

alrededor de 5 años hace | 0

Respondida
How to set up a function
Hi, There are a few built-in functions of integral in MATLAB, such as int() - symbolic, integral(), quad() - numerical integr...

alrededor de 5 años hace | 0

Respondida
NUMERICAL METHODS DISCRETISATION PROBLEM
Hi, You can employ pdepe()

alrededor de 5 años hace | 0

Respondida
Streamlines over an airfoil
Hi, Here is a good script to simulate Joukowski airfoil: https://www.mathworks.com/matlabcentral/fileexchange/8870-joukowski-a...

alrededor de 5 años hace | 0

Respondida
sinh(ax) plot
Hi, Use this synatx approach: syms x a = [?, ?, ?, ..]; % OR a = input('a = '); V = sinh(a(:)*x); fplot(V, [xmin, xmax...

alrededor de 5 años hace | 0

Respondida
removing samples from a timeseries between certain time intervals
Hi Alexander, The answers to you posed questions as follows in the order of your questions: (1) Remove specific timeseries: ...

alrededor de 5 años hace | 0

Respondida
How can I get real time value from the Simulink scope plot to use inside the MATLAB function block ?
Hi, if you have employed [To Workspace] block, you can use this syntax within your m-file: OUT = sim('ABC.slx'); % Simuli...

alrededor de 5 años hace | 0

Respondida
Help to draw a graph of a function.
Hi, (1) There are some inconsistencies with the initial conditions. As given the formulations can never produce some ripples su...

alrededor de 5 años hace | 1

| aceptada

Respondida
Printing an error message if jacobi's method, does not converges.
Hi, Here is an easy solution: ... if abs (Z-P) < t % if norm(r) < some tolerance , it is converged break e...

alrededor de 5 años hace | 0

Respondida
i need to make space between two bar plot in x axis
Hi, ... bar(diag(n),1); % Change 1 to any other number to make bars closer and more appart ...

alrededor de 5 años hace | 0

Respondida
How can I get real time value from the Simulink scope plot to use inside the MATLAB function block ?
Hi, (1) You would need to simulate your simulink model inside your matlab script that can be done with sin() that you have pr...

alrededor de 5 años hace | 0

Respondida
How to code pde?
Hi, Here are a couple of good documentation libraries with examples: https://www.mathworks.com/help/matlab/ref/pdepe.html h...

alrededor de 5 años hace | 0

Cargar más