필터 지우기
필터 지우기

I wamt to generate spheres with different diameters and display it in a single image one below the other

조회 수: 1 (최근 30일)
clc;
clear all;
close all;
data = csvread("Trial1.CSV");
x = data(:,1);
y = data(:,2);
figure;
plot(x,y);
figure;
[X,Y,Z] = sphere;
surf(X,Y,Z)
axis equal
hold on
for r = y;
for j = 1:4:12
X2 = X*r;
Y2 = Y*r;
Z2 = Z*r;
surf(X2, Y2, Z2)
end
end
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To operate on each element of the matrix
individually, use TIMES (.*) for elementwise multiplication.
I have a signal that was obtained from a sensor. I want to use the signal's changing value to generate spheres and display the spheres one below the other. Please find the signal below and the output that I expect to have.
P.S. I am very new to matlab, so please let me know if I need to provide any more information
  댓글 수: 1
Image Analyst
Image Analyst 2022년 11월 22일
편집: Image Analyst 2022년 11월 22일
Try the viscircles function
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
I'm not sure how your signal relates to a sphere, like what does it have to do with a sphere or multiple sphere's radius or center location?

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

답변 (1개)

Prateek
Prateek 2022년 11월 25일
Hello Aditya,
For better assistance, could you elaborate on your requirements? Please do include the relationship between the sphere dimensions (X,Y and Z in your code) and the sensor data (x and y in your code).
Regards,
Prateek

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by