error in my code

2 次查看(过去 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