解决了java+matlab混编+web(jsp)调用Matlab,网页中显示Figure,详细实例

本文详细介绍了如何通过Java和Matlab混合编程,将Matlab生成的figure显示在JSP网页上。首先,参照官方文档学习WebFigure的使用,然后配置Java环境,编译Matlab函数为Java包,接着创建Dynamic Web Project,配置JSP和web.xml,最后部署到Tomcat并成功运行显示图形。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

官方文档介绍的比较详细,建议先参照Implement a WebFigure开始学习

官方文档:

一: Figures and Images(官方汇总贴)

Manipulate MATLAB® graphics from a deployed application

Java® applications can display MATLAB generated figures and images in three ways:

  • Display the generated image on the local machine.

    When your MATLAB code opens a figure window, the MATLAB Runtime displays the window on the local machine. The displayed figure is a fully functional MATLAB figure and can be manipulated as such. The only limitation is that it cannot be displayed on remote machines and is therefore not suitable for distributed applications.

  • Export the figure as an image stream.

    Image streams are the native Java mechanism for handling image data. Generated MATLAB images are returned the to the Java application as static binary image streams. The Java application layer is free to manipulate the data using its own image processing capabilities. To leverage the MATLAB capabilities, the Java application must have the MATLAB code generate a new image.

  • Export the figure using the WebFigures feature.

    WebFigures displays the generated images in a web browser using Java Servlet Page(JSP)s. The displayed figures and images have basic controls for zooming, rotating, and positioning.

 

Functions

webfigure Export a figure to a deployed application
figToImStream Stream figure as byte array encoded in specified format

Examples and How To

WebFigures

Implement a WebFigure

Example illustrating how to implement a WebFigure

Attach a WebFigure to a Server Cache

Information on ways to attach a WebFigure to server cache

Reference a WebFigure Using the JSP Tag

Information on using a JSP tag to reference a WebFigure

Reference a WebFigure Using an Embeddable String

Information on using an embeddable string to reference a WebFigure

Use MATLAB Compiler SDK Web Example Guide

Brief description of the web example guide

Image Streams

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值