已回答
Index exceeds the number of array elements. Index must not exceed 1
You are overwriting the C_Y array in your for loop. You initialize C_Y as a 5x5 zeros matrix and in the first iteration of your ...

3 months 前 | 0

| 已接受

已回答
help with nested loop and plot
Here is one simple dirty way: n= 101; x = linspace(-100, 100, n); y = linspace(-100, 100, n); [X, Y] = meshgrid(x, y); Z = ...

3 months 前 | 0

已回答
Accessing cell array entries using arrays
I think you want to use B columns as indeces to extract info from A, so: A=cell(2,2); B=[1 2 2 1 1; 2 1 2 1 2] A{1,1}=[4...

3 months 前 | 0

已回答
what is the meaning of error "Index exceeds the number of array elements. Index must not exceed 8."
it means the size of y variable is 8 abd you are trying to get 9th 10th 11th index of the y vector. This is because your initial...

3 months 前 | 0

已回答
Someone help me to plot Ids vs Vds for HEMT AlGaN/GaN
I think what you are trying to do is vary Vds and see what Ids becomes. So here is a simple some modification for it using for l...

3 months 前 | 0

已回答
Generating triangle wave form
You can use the general equation for the triangle wave and implement it using simple simulink blocks t = 0:0.01:10; % time f =...

3 months 前 | 0

| 已接受

已回答
How to use fminunc for a 2D function composed of two functions?
You dont seem to have a double function. So here is a code to solve your problem. You have local minimas so fmincon and brute f...

3 months 前 | 0

| 已接受

已回答
the matrix addition should come 0 but it is not happening
Given the difference is 1e-12, it is probably floating point issue. Floating points list significant bit is generally unreliable...

3 months 前 | 1

已回答
How can I make such that every method call to a class is routed through a wrapper
Any reason why you are not using wrapper_func with an input argument that determines which method it should call? With this you ...

3 months 前 | 0

| 已接受

已回答
Can't stabilize system with PID
One thing you can do is use symbolic PID gains, plug them in your closed loop transfer function, and find the values via pole pl...

3 months 前 | 0

| 已接受

已回答
How to set upper x-axis ticks values and locations?
You were changing the label name at 30 60, instead of their actual values, so here is one dirty way but I recommend you follow t...

3 months 前 | 0

| 已接受

已回答
finding non zero solution for homogeneous system of equations
Since zeros(7,1) is kind of a solution for you, you should select your initial value away from that point. Below you can find a ...

3 months 前 | 1

已回答
Matlab plot is drawing an individual line to each data point
You have a lot of 0s in your nc and x vector, hence you go back and forth to 0 position. You can see this if you use a data poin...

3 months 前 | 0

| 已接受

已回答
Strange behavior when initializing empty cell in struct()
If you want to define the property as empty, then you should use '[]' instead of '{}'. obj = struct(MyProp=123, MyOtherProp=[])...

3 months 前 | 1

已回答
I want to calculate the eigenvalues form the very huge sparse mass and stiffness matrix.
If eig() function is taking too long, you can use eigs() function. Example from mathworks eigs() site: A = delsq(numgrid('C',1...

3 months 前 | 0

| 已接受

已回答
How to nest and call the fmincon function in Simulink?
EDITED: to fix the initial_values to be a 3x3 matrix instead of lambda Your issue was in the line initial_values=[lambda(1,1)...

3 months 前 | 0

已回答
How to simulate code in symbolic form?
Here is one way, though it cannot solve it at one point I think so throws an error when asked to display the solution % assume ...

4 months 前 | 0

已回答
delete zero in signal
Your question is a bit ambigious but if you just want to remove the 0 s from the signal you can use a switch and delay block to ...

4 months 前 | 0

已回答
Unknown variables appearing in solutions for symbolic equation solver
This is shown in the documentation of solve, under Solve Polynomial Equations of High Degree. You should call the function wit...

4 months 前 | 0

已回答
What is MATLAB doing when adding multiple ZPK transfer functions together?
Yes but you are doing a fractional algebra. To refresh your memory: a/b + c/d = (a*d + c*b)/(b*d) Since numerator stays b*d, ...

4 months 前 | 0

已回答
Want to programmatically get the Maltlab status of (ready, busy), etc., in the bottom left corner of the window. What procedure will be used?
I recommend you use waitbar() function as an indicator of the progress within the code. f = waitbar(0,'Program started...'); %...

4 months 前 | 0

已回答
How to save a output matrix in each iteration?
Here is one way, where M_total_P is a 2x2x901 matrix, where 901 is the number of frequencies you have in the code. clc clear ...

4 months 前 | 0

已回答
I am getting this warning "Matrix is singular to working precision." and my surf plot is not showing.
You are doing a matrix mutiplication when you call the u() function, since you call u function with matrix arguments X and Y. Th...

4 months 前 | 1

已回答
Gain dimension failure ending in error
G gain is set for element wise multiplication instead of matrix multiplication, hence (1,4).*(4,1) = (4,4). x = ones(4,1); G =...

4 months 前 | 0

| 已接受

已回答
change the color of curve from blue to any color and make it bold
x= 0:0.01:2*pi; y = sin(x); plot(x,y,'r') % r stands for red look at the documentation for different colors

4 months 前 | 0

| 已接受

已回答
Hi, why am I getting an error?
You provide a fitlm model to plot function and a color option. Remove the color option and try again. So change % plot(F_sept...

4 months 前 | 1

| 已接受

已回答
Unrecognized function or variable 'del'.
Not recommended but you can generally overwrite native variable/function names. I cannot reproduce your problem n = 0; for del...

4 months 前 | 0

已回答
How to make the encircled curve by blue.
You have one weird data and script to visualize but here is one way clear all warning off % you had references to F:/ folder ...

4 months 前 | 0

| 已接受

已回答
How to vary angles at constant rate in a kinematics problem?
For loops are easy to understand but as mentioned in comments, once you understand the logic you should vectorize it. The basic ...

4 months 前 | 0

| 已接受

已回答
how to get the name of current running m script
mfilename() function seems to be what you are looking for.

4 months 前 | 0

| 已接受

加载更多