Frage

How to publish results from the command window in MATLAB

Hi, I ran a code it took 5 hours to give me results in the command window now I want to print the results from the command wind...

etwa 4 Jahre vor | 3 Antworten | 0

Frage

How to use questdlg to ask the user for an action?

I want to ask the user to make a choice on which function to excute the algorithm is as follows: Ask the user "what type of se...

etwa 4 Jahre vor | 1 Antwort | 0

Frage

The crtrp function from the genetic-toolbox doesn't work

Whenever I try to run the code, it gives me an erorr saying: Error: File: crtrp.m Line: 34 Column: 19 "nargin" previously appe...

etwa 4 Jahre vor | 1 Antwort | 0

Frage

I have problem writing a matlab function

I want to write this function in matrix form. The function is I defined the vector as: Then what is wrong with my code? fu...

etwa 4 Jahre vor | 3 Antworten | 0

Frage

A question about sorting a vector

Suppose I have a column vector V of length N and I map every element in V to an element y in Y so, we have a column vector Y of ...

mehr als 4 Jahre vor | 1 Antwort | 0

Frage

How to find the position of an element in a vector

Hello, Is there a function in matlab that takes a column vector of n rows and a number as an input and returns its position ...

mehr als 4 Jahre vor | 2 Antworten | 0

Frage

How to generate a random integer between two bounds?

Hello, I want to generate a random integer between two integers Suppose the upper bound UP=500 and the lower bound LB=4 how ...

mehr als 4 Jahre vor | 1 Antwort | 0

Frage

Why the function "bi2de" only returns non-negative integers, when the description says it returns non-negative real numbers!

I read that the function bi2de takes any binary vector - "a vector composed of only zeros and ones" and returns a non-negative r...

mehr als 4 Jahre vor | 1 Antwort | 0

Frage

Why does matlab return "Index exceeds matrix dimensions"?

Hello, Nind=2; %number of vectors Nvar=2; %number of variables in each vector perci=3; %number of bits of every variable p...

mehr als 4 Jahre vor | 0 Antworten | 0

Frage

A question about the simple genetic algorithm code

This is a code I found of the genetic algorithm. I am a beginner in MATLAB but I really would like to understand the code. The C...

mehr als 4 Jahre vor | 0 Antworten | 0

Frage

Given a column matrix of numbers, how to extract some numbers that meet some condition and save them in a new matrix, if I don't know how many numbers will meet the condition?

Suppose I have a matrix R of n rows and 1 column, suppose I want to extract all numbers from matrix R that are less than or equa...

mehr als 4 Jahre vor | 1 Antwort | 0

Frage

Error: The first argument must be a scalar.

I defined a matrix of variables like this X=sym('X', [4,1]) %it looks like this X=[X1 X2 X3 X4]' Then the code did some stu...

fast 5 Jahre vor | 1 Antwort | 0

Frage

Loop over non-numeric stuff

Hello, I defined a vector of variables in my code like this x=sym('x', [m,1]) then I defined a matrix M as follows M=zeros(m...

fast 5 Jahre vor | 0 Antworten | 0

Frage

I have an idea that I want to write in MATLAB language

I am trying to write a MATLAB code that does the following the user should enter 3 vectors (x1, x2, x3) each has 2 components th...

fast 5 Jahre vor | 1 Antwort | 0

Frage

Need some help with a while loop

x0=[0.8 0.8 0.2 0.2]'; tol=1e-6; m0=[0.5 0.5]'; syms x y z p m1 m2 h1=y-(x^3)-(z^2); h2=(x^2)-y-p^2; h=[h1 h2]'; f=-x; ...

fast 5 Jahre vor | 1 Antwort | 0

Frage

Something is wrong in my line search gradient descent code. It gets stuck!

x0=[10 5]'; x0=[10 5]'; tol=1e-6; syms x y f= (1/2)*(x^2)+(9/2)*(y^2); g=gradient(f, [x, y]); g0=subs(g, x, x0(1,1)); g0=...

fast 5 Jahre vor | 1 Antwort | 0