error in my code

조회 수: 1 (최근 30일)
thelong le
thelong le 2021년 6월 12일
편집: Stephen23 2021년 6월 12일
I can't use csview() command, when I run the program, my command shows an error (' Unrecognized function or variable 'csview'.' )
and my code
% generate two clusters of color points
rgb = min(abs(randn(2000,3).*[0.5 0.3 0.1] + [0 0 0]),1);
rgb = [rgb; 1-rgb];
xyz = rgb2xyz(rgb);
xlabel('X');
ylabel('Z');
zlabel('Y');
hold on;
% plot the points
scatter3(xyz(:,1),xyz(:,3),xyz(:,2),10,rgb,'.');
view(3); grid on;
axis equal
axis([0 1 0 1.1 0 1]);
set(gca,'color','k','gridcolor','k','gridalpha',0.3)
set(gca,'projection','perspective');
view('xyz','alpha'0.2,'invert',1); hold on; % do this before scatter3()
how to fix this
many thanks ^^

답변 (1개)

Stephen23
Stephen23 2021년 6월 12일
편집: Stephen23 2021년 6월 12일
You need to download this FEX submission (by clicking on the big blue "Download button"):
and unzip it onto your MATLAB Search Path or into the current folder.
Have you done that?
  댓글 수: 2
thelong le
thelong le 2021년 6월 12일
I have downloaded and unzipped them according to the path in (C:\Users\DELL\Downloads\_temp_matlab_R2021a_win64\bin\win64)
but my program still shows the above error, is there any other solution, many thanks
Stephen Cobeldick!
Stephen23
Stephen23 2021년 6월 12일
편집: Stephen23 2021년 6월 12일
Do NOT add, remove, alter, edit, or change in any way the files in the MATLAB installation directories!
This is a very odd path, it looks like an installation or temporary installation path:
C:\Users\DELL\Downloads\_temp_matlab_R2021a_win64\bin\win64
A BIN directory is a big red flag, telling you "no, do not work in this directory". As a beginner you should put all of your own files (and any files you download, etc) into the default MATLAB startup directory, which on Windows is:
C:\Users\<user>\Documents\MATLAB
You can also save MATLAB files in other locations and change the Search Path to suit:
but NEVER in any installation directories of ANY application installed on your computer.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by