Respondida
Linear constraints not satisfied during optimization using fmincon
First, learn to use function handles. myfun = @(x) (0.0114*x(1)+0.01032*x(2)+0.0228*x(3)+0.0081*x(4))+15*((log(0.0114*x(1)))+(l...

más de 4 años hace | 0

| aceptada

Respondida
Getting odd output, want to understand the meaning of it
syms Ed m V L En Eqn = (Ed-m-(1/2)*(V))*(2/L)^(2/(0.1+2))*(m+Ed)^(0.1/(0.1+2)) - m*En*(m*L)^(-2/(0.1+2)) == 0 S = simplify(so...

más de 4 años hace | 1

Respondida
I am trying to create this matrix ; How can i do this using for loops or without loops?
Without loops? Trivial. A=[0 0 0 0 0 0 0 0 0 ; 1 1 1 0 0 0 0 0 0 ; 1 1 1 1 1 1 0 0 0 ]; A As you can see, that works nicely. ...

más de 4 años hace | 0

Respondida
logarithmic binning data in matlab
It is not clear what you mean by logarithmic binning. Looking at your data however, tells me that you were told to do something...

más de 4 años hace | 0

Respondida
MATLAB license renewal Master License 3XXXXXXXXXX
It was renewed. You don't need to download anything at this point. You can just keep on using MATLAB.

más de 4 años hace | 1

| aceptada

Respondida
How can i save the values i get in a for loop in a matrix?
Pretty basic, really. You probably need to spend some time with the MATAB Onramp tutorial. N = 100; SavedData = NaN(1,N); % Pr...

más de 4 años hace | 2

Respondida
i am getting this error "Brace indexing is not supported for variables of this type" at line which contains (S_bar{i}=R{i}*T_1{i}*R_1{i}*S{i}*T{i});.
Is S a regular matrix? S=[1/E1 -mu_12/E1 0;-mu_12/E1 1/E2 0;0 0 1/G12]; Yes. You then you assume it is a cell array for some r...

más de 4 años hace | 0

Respondida
How can I fit a smooth curve to this data and get the equation of the curve?
It is a bad idea to name your variables with the same name as an existing and useful MATLAAB function. Power is one such example...

más de 4 años hace | 0

| aceptada

Respondida
Solving a highly non linear equation in Matlab
This is a differential equation. An ODE, because it involves derivatives wrt only one variable. It is high order, and nonlinear,...

más de 4 años hace | 1

Respondida
When chromaticity diagram meets a line
Describe the diagram border as a polygon. That just means you need to get the sequence of points on the boundary, IN SEQUENCE, a...

más de 4 años hace | 0

| aceptada

Respondida
How to plot a set as the constraint in 2D?
Think clearly about what you are asking to plot. sqrt(x1^2 + x2^2) < x1 Do you agree that x2^2 is ALWAYS a positive number,...

más de 4 años hace | 1

| aceptada

Respondida
How to convert variables in a function handle ?
Um, not easily, and yes, sort of. If you want to actually modify the function handle, then that would take some effort and text...

más de 4 años hace | 0

Respondida
How to create a matrix using Booleans that looks like this:
There are always a million ways to solve such a problem, however, there is no need to use booleans at all. Best is if you learn ...

más de 4 años hace | 0

Respondida
How to solve trigonometric equation x*cos(x)+sin(x)=0 with function fsolve?
This is just a variation of a problem I've seen given many times. It is one of the simplest equations I can think of that has no...

más de 4 años hace | 0

Respondida
Why are there variations in values when using floor function?
Do you understand that it is impossible to represent most fractinos as floating point numbers, and do so exactly? That is, is th...

más de 4 años hace | 0

Respondida
Spline Interpolation for Motion Profile
You can't get an "equation" for a spline. Well, you can, IF you understand splines in some depth, but it is a bit of a piecewise...

más de 4 años hace | 0

Respondida
How to make matlab give me a numeric answer to a matrix with infinite solutions
MCh =[ 1 0 -1 0 5 0 0 -1 0 2 -3 -1 0 1 -4 0]; rank(MCh) You wish to solve the 4x4 homoge...

más de 4 años hace | 0

| aceptada

Respondida
null() fails for a symbolic numeric 5x5 matrix
It is often difficult to know what a compiled code has done under the hood, especially when symbolic operations are involved. Ho...

más de 4 años hace | 0

Respondida
generating random numbers from poisson distribution
Since the request has now morphed to do so without using poissrnd, that makes it very likely homework. In that case, you might ...

más de 4 años hace | 0

| aceptada

Respondida
the meaning of a sentence in command window
I think you are perhaps confused. And the answers are a bit confusing too. And, of course, we don't know any characteristics of ...

más de 4 años hace | 1

Respondida
Find rows with common values using intersect
Intersect is the wrong way to approach this, I think. And at the same time, the solution is probably going to seem easy, once yo...

más de 4 años hace | 0

Respondida
Optimization of weighted sum
First, LEARN TO USE ARRAYS!!!!!!!! Don't create 8 different numbered variables. Why does that make sense, when you can create O...

más de 4 años hace | 2

Respondida
Associating another Person's Academic MatLab License with my name.
You can contact Mathworks, and ask them. To be honest, the answer is your scheme is probably not legal, since it is essentially ...

más de 4 años hace | 0

| aceptada

Respondida
I need to find the length of the longest strictly increasing subsequence array from a given array I just need a tip to start. Any type of help will be appreciated
Can you use diff on your vector? What property does the result of diff have on strictly increasing sequences? Will all elements ...

más de 4 años hace | 0

Respondida
error in integration of function
You don't understand. You define x. i and N are numbers. i = 1; N = 100; h = 1/N; x = (i-1)*h; What is x now? A number. Gr...

más de 4 años hace | 1

Respondida
Cannot simplify a result
You got a "numerical" result. But because the result is symbolic, that is the symbolic result. pi, and square roots are as you w...

más de 4 años hace | 0

Respondida
before running the code then Px would be considered to be a variable instead of a function. You might have assigned something to Px in an earlier version of the code and not c
for i = 0:len-1 dif = a(i+1,1) - a(i,1) i starts out at 0 in the for loop. Does MATLAB alow a 0 index for an array? (NO.)...

más de 4 años hace | 1

Respondida
How to speed up the code to check if randomly generated number in a certain range is a prime ?
The simple answer is to generate the primes in that range, ALL of them, and then look to see which of your randomly generated el...

más de 4 años hace | 0

Respondida
swapping two matrices with similar randomness
You just need to learn how to use indexing. A = [1 2 3 4 5]; B = zeros(5,2); B(:,2) = A/10 Note that even thoiug...

más de 4 años hace | 0

Respondida
how to set a loop to calculate time
EVERY pass through your loop, you REDEFINE the variable t. Learn to use MATLAB. Stop thinking in terms of loops for everything. ...

más de 4 años hace | 0

Cargar más