I'm trying to make logic gates in the GUI ( app designer) but when i put the logical expression i get the error saying Value must be double scalar, How do i fix this ? Please help.
    2 views (last 30 days)
  
       Show older comments
    
    Abdul wadood Mohammed
 on 26 May 2018
  
    
    
    
    
    Edited: Ameer Hamza
      
      
 on 26 May 2018
             a = app.val1.Value;             
 b = app.val2.Value;                            
 app.result.Value = a & b;
Error using matlab.ui.control.internal.model.AbstractNumericComponent/set.Value (line 110) 'Value' must be a double scalar.
0 Comments
Accepted Answer
  Ameer Hamza
      
      
 on 26 May 2018
        
      Edited: Ameer Hamza
      
      
 on 26 May 2018
  
      It appears that the val1 and val2 are text type edit field, therefore a and b will have char class. Whereas result is a numeric edit field. If a and b have multiple characters then a&b will be an array and thus cannot be assigned to a scalar numeric field. You will need to take care of the type of edit field, you are trying to assign the value.
0 Comments
More Answers (0)
See Also
Categories
				Find more on Develop Apps Using App Designer in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
