Unrecognized function or variable 'yalmip'.

56 ビュー (過去 30 日間)
Hajar Alshaikh
Hajar Alshaikh 2023 年 3 月 5 日
回答済み: Sachin 2023 年 3 月 13 日
matlab should known sdpvar in the code becuse if i used help it give me the meaning of it but it said instead
Unrecognized function or variable 'yalmip'.
Error in sdpvar (line 518)
[mt,variabletype,hashed_monoms,current_hash] = yalmip('monomtable');
% Define the partially specified Euclidean distance matrix
D = [0 1 0 3; 1 0 2 0; 0 2 0 0; 3 0 0 0];
% Define the size of the matrix
n = size(D, 1);
% Define the optimization variables
X = sdpvar(n, n);
% Set up the optimization problem
Constraints = [X == semidefinite(n), diag(X) == zeros(n, 1), X >= 0];
Objective = sum(sum((X - D).^2));
Options = sdpsettings('solver', 'mosek');
% Solve the optimization problem
optimize(Constraints, Objective, Options);
% Extract the completed Euclidean distance matrix
D_complete = value(X);
  4 件のコメント
Hajar Alshaikh
Hajar Alshaikh 2023 年 3 月 5 日
I want also to check or insatll the CVX package
Luca Ferro
Luca Ferro 2023 年 3 月 6 日
use the command ver to find every package installed and visible

サインインしてコメントする。

回答 (1 件)

Sachin
Sachin 2023 年 3 月 13 日
As per my understanding you are facing issue in ‘yalmip’ implementation. Referring the following information might be of good help to you assuming that you are using MATLAB R2022b.
  1. Check if you have installed ‘yalmip’ in your system by following command in MATLAB.
V = yalmip('version'); % to check version of 'yalmip'
2. If You have not added the path after downloading the zip file.
You can refer the following information to know more about add path.

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by