error in my code

1 view (last 30 days)
thelong le
thelong le on 12 Jun 2021
Edited: Stephen23 on 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);
hold on;
% plot the points
view(3); grid on;
axis equal
axis([0 1 0 1.1 0 1]);
view('xyz','alpha'0.2,'invert',1); hold on; % do this before scatter3()
how to fix this
many thanks ^^

Answers (1)

Stephen23 on 12 Jun 2021
Edited: Stephen23 on 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?
Stephen23 on 12 Jun 2021
Edited: Stephen23 on 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:
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:
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.

Sign in to comment.


Find more on Introduction to Installation and Licensing in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by