Answered
How do I generate a plot in a vector having symbols?
There are several unknown (not predefined) variables without which it is impossible to get any values and plots, as well. Check ...

4 years ago | 0

Answered
Solving a wave equation in matlab
Here is a part of your code that is corrected: xstep = 0.1; tstep = 0.05; xstep2 = xstep*xstep; tstep2 = tstep*tstep; alph...

4 years ago | 0

Answered
How can I take an integer like n=1:1:50 and get the output for each value?
Without knowing the size of your variables and just presuming some variables to be scalar and others to be a vector, here is the...

4 years ago | 0

Answered
Contour Graph/Plot displays edgy function
The answer to your posed question lies in the formulation of phi and psi. By decreassing the step size by a factor of 10 for ins...

4 years ago | 1

Answered
c coefficients in pde non constant
Try to use del2() for the Laplacian calcs.

4 years ago | 1

Answered
Cross-validated model parameters extraction in fitcecoc SVM linear kernel
You should use these fcns instead of crossval: kfoldPredict(), predict(), resubPredict() See for more info: https://www.mat...

4 years ago | 0

Answered
How do I determine the index for a specific character string based on its relationship with another character string in the same column?
You'd need to perform the following procedures: DATA import (data read) into MATLAB workspace. Advise to use readtable() Emplo...

4 years ago | 0

Answered
How to find a delay between two similar vectors
Here is one of the possible solution routines: load('J.mat') plot(J2(:,1), J2(:,2:3)) D2=diff(J2(:,2)); D3=diff(J2(:,3)); h...

4 years ago | 0

Answered
how to substitute multiple variables of syms toolbox into matrix elements using subs function.
Note that you don't need subs instead you'd need to save all calc values in a cell array. Here is the corrected part of your cod...

4 years ago | 0

| accepted

Answered
Finite Difference Boundary Condition
One of the possible solutions is to increase the simulation time T from 3 (T = 3) seconds to 5 (T=5) or more seconds.

4 years ago | 0

Answered
How to draw a graph for function with constraints?
You can consider fplot(): https://www.mathworks.com/help/matlab/ref/fplot.html

4 years ago | 0

Answered
What should go in a next-generation MATLAB X?
Another good and useful tool for students is to have a built-in function to reset all changes made by a user in preferences and ...

4 years ago | 2

Answered
What should go in a next-generation MATLAB X?
One of the most common pitfalls for the beginners are how to do correct memory allocation even though MATLAB automatically pinpo...

4 years ago | 0

Answered
Extracting non zero values from structure variable
Use logical indexing to take out non-zero values from a sturcture array, e.g.: S.m(1) =0.1; S.m(2:5)=0; S.m(6:9)=pi; S.k(1:3)=...

4 years ago | 0

| accepted

Answered
Solving for multiple solutions and plotting them
Here is the corrected code: clc; clearvars format short g M1 = 3; P1 = 1; theta2 = 1:1:20; gamma = 1.4; phi = 4.8; syms ...

4 years ago | 0

Answered
How to mark range of Y values in a plot?
Here is one of the viable ways how you can achieve your goal of simulation: clearvars; close all k=100; % ...

4 years ago | 1

Answered
using voltage sensor in program code
There are a few different ways to obtain signal readings into matlab workspace. (1) using [out] block (Simulink/Sinks) connecte...

4 years ago | 0

| accepted

Solved


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

4 years ago

Answered
How to wrap live editor output
Use Preferences, e.g.: >> preferences In Preferences, Editor/Debugger -> Display ...

4 years ago | 1

Answered
how to I get the equation of polynomial fit into my code
Use these icons to export the fit model into workspace as shown in the Screenshot shown here. Then use the exported fit model...

4 years ago | 0

Answered
using voltage sensor in program code
(1) Make sure that you have Data Acquisition toolbox installed. And if it is there, then you can check the followings. (2) find...

4 years ago | 0

Answered
Defining a function for a vector of values, while keeping two variables unknown
% Here is the complete solution syms y z A =1:5; F = @(A, y, z) sum(A+y+z); FF = (F(A, y,z))

4 years ago | 0

Answered
How to add a .png image to be published as a pdf output file
Note the file extension - Part1.jpg That looks like that in your code the file extension is NOT *.png but *.jpg Your image fi...

4 years ago | 0

Answered
Defining a function for a vector of values, while keeping two variables unknown
Supposedly, this is what you are trying to achieve: syms y z A = magic(3); F = @(A, y, z) cumsum(A+y+z); FF = (F(A, y,z))

4 years ago | 0

Answered
dot product and indexing
The explantion is as follows: % Step 1. Comparing every individual value (element of) of NCol row vector (row matrix) % with ...

4 years ago | 0

Answered
How to add the count of iterations and relative error to the code?
Here are how you can obtain the final iteration and rel./abs error values when the roots are found. function root = newton(fun...

4 years ago | 0

Answered
I want to solve solution for Equation which is behaving like both ODE and DDE
You can try to employ Laplace and inverse Laplace transforms, laplace() and ilaplace()

4 years ago | 0

Answered
How do I create a for loop with fields of structures?
You can try to work with fieldnames() and getfield() names, e.g.: Fnames = fieldnames(Global_Data); for ii = 1:length(Fnames) ...

4 years ago | 1

Answered
Two area three unit thermal power system
In your m-file, one of the variables is not initialized correctly, see: ... b1=0.4249; b2=0. % ERR 4249...

4 years ago | 0

Answered
Index is out of range when creating 3D arrray
If NUM_data = 40, then your code should sth like this one: ... for n = 1:NUM_data X(:,:,n) = dlmread(list(n)); end ....

4 years ago | 0

Load more