error in my code

2 Ansichten (letzte 30 Tage)
thelong le
thelong le am 12 Jun. 2021
Bearbeitet: Stephen23 am 12 Jun. 2021
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 ^^

Antworten (1)

Stephen23
Stephen23 am 12 Jun. 2021
Bearbeitet: Stephen23 am 12 Jun. 2021
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 Kommentare
thelong le
thelong le am 12 Jun. 2021
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 am 12 Jun. 2021
Bearbeitet: Stephen23 am 12 Jun. 2021
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by