limits are too large

94 ビュー (過去 30 日間)
Kuatra Patil
Kuatra Patil 2019 年 4 月 20 日
コメント済み: Kuatra Patil 2019 年 4 月 21 日
i have parametrized surface equation T(u,v)=e^(u^2+v^2) i + ln(2*v) j + tan(5*u) k . I used this code to plot it in 3D but it gives error 'limits are too large '. can yu help me pls.
clc; clear all ;
M = 100 ; N = 100 ;
uinf = 100 ;
u = linspace(0,uinf,M) ;
v = linspace(0,2*pi,N) ;
[U V] = meshgrid(u,v) ;
X = exp(U.^2+V.^2) ;
Y = log(2.*V) ;
Z = tan(5*U) ;
surf(X,Y,Z) ;

採用された回答

Image Analyst
Image Analyst 2019 年 4 月 21 日
Try this:
clc;
clear all;
M = 100;
N = 100;
u = linspace(0,.1,M);
v = linspace(0,.2,N);
[U, V] = meshgrid(u,v);
X = exp(U.^2+V.^2);
Y = log(2.*V);
Z = tan(5*U);
surf(X,Y,Z, 'EdgeColor', 'none');
xlabel('X');
ylabel('Y');
zlabel('Z');
0000 Screenshot.png
  1 件のコメント
Kuatra Patil
Kuatra Patil 2019 年 4 月 21 日
yu da real MVP

サインインしてコメントする。

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2019 年 4 月 20 日
X contains values up to +infinity . Y contains values as smal as -infinity . surf() cannot draw with X and Y coordinates that large.
Your u is as large as 100 and your v is as large as 2*pi, so U^2+V^2 is as large as 10000+4*pi^2 . You take exp() of that, and that overflows. It is a number that is approximately 10^451.

dpb
dpb 2019 年 4 月 20 日
K>> format short
K>> sum(X(:)>1E100)/numel(X)
ans =
0.8499
K>> sum(X(:)>1E200)/numel(X)
ans =
0.7848
K>> sum(X(:)>1E300)/numel(X)
ans =
0.7383
K>> sum(X(:)>1E301)/numel(X)
ans =
0.7371
K>> sum(X(:)>1E302)/numel(X)
ans =
0.7362
K>> sum(X(:)>1E305)/numel(X)
ans =
0.7344
K>> sum(X(:)>1E307)/numel(X)
ans =
0.7334
K>> sum(isinf(X(:)))/numel(X)
ans =
0.7329
K>> sum(isfinite(X(:)))/numel(X)
ans =
0.2671
K>>
Your X value is "blowing up" beyond limits of what can hold in double precision...pare down the upper limits of u,v to something reasonable.

カテゴリ

Help Center および File ExchangeCartesian Coordinate System Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by