C#Matlab类型的命令窗口? [英] C# Matlab type command window?
本文介绍了C#Matlab类型的命令窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一个库或组件允许在我的c#程序中显示"matlab"类型的命令窗口(带有数学函数),从而允许用户在datagrid视图中操作数据?
Hi, is there a library, or component that allow be to display a ''matlab'' type command window (with math functions) in my c# program that would allow the users to manipulate the data in a datagrid view?? similar to how I would manipulate a workspace in matlab via the command window?
推荐答案
我相信答案是是的",并且它已经在.NET中出现了.给你的.
检出System.Data库的DataTable.Compute方法;我想您会发现,即使不将其与DataTable实例相关联,也可以轻松地基于字符串输入执行任意数学计算,这会让您像我一样感到惊讶.
我在这里偶然发现"了这种技术:[ ^ ].
根据FrameWork文档,您可以在DataTable.Compute消耗的字符串中操作DataTable实例的行和列.但是,这是我自己没有尝试过的事情.
例如,有关操作列的示例,请参见DataColumn.Expression上的MS文档.
语法使我想起了很多Excel单元格语言".
拥有此工具非常好,如果您的数学集有限,则需要解析和执行,而不必担心使用CodeDom以及即时编译和执行的麻烦.
I believe the answer is "yes," and it''s already in .NET for you.
Check out the System.Data library''s DataTable.Compute method; I think you''ll be as surprised as I was by seeing how easily you can perform arbitrary math calculations based on string input, even without it being associated with an instance of a DataTable.
I ''stumbled'' across this technique here:[^].
According to the FrameWork docs, you can manipulate rows and columns of an instance of a DataTable in the string that DataTable.Compute consumes; this is something I have not tried myself, however.
For example, see the MS docs on DataColumn.Expression for examples of manipulating Columns.
Syntax reminds me a lot of Excel "cell-language."
Very nice to have this tool, if you have a limited set of maths you need to parse and execute without going to the trouble of using CodeDom and on-the-fly compilation and execution.
这篇关于C#Matlab类型的命令窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文