Why does the the Str command not work in Visual Basic after I add MatrixVB as a reference in my project?
1 view (last 30 days)
Show older comments
Why does the the Str command not work in Visual Basic after I add MatrixVB as a reference in my project?
This command is a standard Visual Basic command that works when I am not using MatrixVB. An example is shown below:
Str(1)
When I use MatrixVB, the following error is returned:
Compile Error: Invalid use of property.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
The error message you are getting indicates an incorrect usage of the Str property of MatrixVB matrices. The Str property returns "True" if the matrix is a string matrix and "False" if the matrix is a numeric matrix.
The correct usage of the Str property is shown below:
Dim cs, ds As String
Private Sub Command1_Click()
A = strcat("This is a String")
B = randM(2, 2)
cs = A.Str
ds = B.Str
Text1.Text = cs
Text2.Text = ds
End Sub
To access the Visual Basic function the following command can be used:
VBA.Str(112)
0 Comments
More Answers (0)
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!