why is not possible to do the logic also why not display
    1 vue (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Milan Sumegi
 le 15 Déc 2018
  
    
    
    
    
    Modifié(e) : madhan ravi
      
      
 le 15 Déc 2018
            Hi 
I dont know why I cant display my logick code also an error message on it as well
>> u=symunit; 
L= input('Lenght of the wind turbine blade in meter: ')*u.m; 
L=unitConvert(L,u.mm); 
W=8500*u.N;  
E=42000 *u.N/u.mm^2; 
I=10*(10^6)*u.mm^4; 
D=vpa((W*L^3)/(8*E*I));
Limit= L*0.1;
if D<=Limit disp('Maximum deflexion is tolerable')
else disp('Maximum deflexion will be exceeded')
end
Lenght of the wind turbine blade in meter: 10
Conversion to logical from sym is not possible. 
0 commentaires
Réponse acceptée
  madhan ravi
      
      
 le 15 Déc 2018
        
      Modifié(e) : madhan ravi
      
      
 le 15 Déc 2018
  
      P.S - you get an error because L is of symbolic class because you have added (u.mm) unit which belongs symbolic math toolbox , just the numerical value should be used in the if statement , lookup removeUnits() but I guess it works only for user defined functions not for predefined functions.
You need to add tolerance to satisfy the condition because your D is a float number , type floating-point as a tag in this forum to understand more about working with float numbers
if abs(D-Limit)<=1e-4 
0 commentaires
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Calculus dans Help Center et File Exchange
			
	Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

