How to fix this error:"Input arguments must be convertible to floating-point numbers."

조회 수: 5(최근 30일)
CHUNYI YEH 2021년 1월 25일
편집: CHUNYI YEH 2021년 1월 30일
I want to use the maximum value to solve R, but I don't know how to fix the error.
clc; clear all; close all;
syms R
step = 10^-12;
t = [-1*10^-8 : step : 1*10^-7];
%R = 2.66e-3;
L = 0.406e-9;
C = 1.716e-9;
a = R/(2*L);
n = 1/(sqrt(L*C));
d = sqrt(((n)^2)-(a^2));
T = 15*10^-9 ; % + sqrt(L.*C)%;
m = A/T;
tow = R*C;
unitstep_1 = t>=0;
unitstep_2 = (t-T)>=0;
Vct_t = unitstep_1.*( t - (2.*a./n^2) + (exp(-a.*t)./d).*(( (2.*a./n).*sin(d.*t + atan(d./a))) - sin(d.*t) ));
Vct_T = unitstep_2.*( (t-T) - (2.*a./n^2) + (exp(-a.*(t-T))./d).*(( (2.*a./n).*sin(d.*(t-T) + atan(d./a))) - sin(d.*(t-T)) ));
Vc = m.*(Vct_t - Vct_T);
Vmax = max(Vc);
ANS = solve( round(Vmax,2) == 13.10 )
  댓글 수: 3
CHUNYI YEH 2021년 1월 26일
Oh, I think it’s not determine. But how to avoid this problem if I need the maximum value? Use for loop to change R and find the maximum value which is equal to my setting?But I think it’s not the best solution...😂 Thank you

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


Gaurav Garg
Gaurav Garg 2021년 1월 28일
Hi Chunyi,
I ran the code as it is, and couldn't reproduce the issue.
  댓글 수: 1
CHUNYI YEH 2021년 1월 30일
Hello, Gautama, thanks for the information. Maybe I will ran again in my lab’s computer, but I don’t think it’s the version problem.🤔

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


Community Treasure Hunt

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

Start Hunting!

Translated by