首页
\
问答
\
未定义函数'int'表示'double'类型的输入参数[duplicate](Undefined function 'int' for input arguments of type 'double' [duplicate])
未定义函数'int'表示'double'类型的输入参数[duplicate](Undefined function 'int' for input arguments of type 'double' [duplicate])
这个问题在这里已有答案:
我试图获得L1与a和b的值的积分,但是它给出了以下错误:未定义的函数'int'用于'double'类型的输入参数。
clear all, close all; clc format long syms t a b; a=0; b=12; dt=0.7; t=a:dt:b ft=exp(-0.2*t).*sqrt(t) Iexc=double(int(sym('exp(-0.2*t)*sqrt(t)'),a,b)) L1 = (((t-a).*(t-(2*a+b)/3).*(t-(2*b+a)/3))./((b-(2*a+b)/3).*(b-(2*b+a)/3).*(b-a))); int(L1, a, b)
This question already has an answer here:
I am trying to get integral of L1 with respect to values of a and b, but it gives the following error: Undefined function 'int' for input arguments of type 'double'.
clear all, close all; clc format long syms t a b; a=0; b=12; dt=0.7; t=a:dt:b ft=exp(-0.2*t).*sqrt(t) Iexc=double(int(sym('exp(-0.2*t)*sqrt(t)'),a,b)) L1 = (((t-a).*(t-(2*a+b)/3).*(t-(2*b+a)/3))./((b-(2*a+b)/3).*(b-(2*b+a)/3).*(b-a))); int(L1, a, b)
原文:https://stackoverflow.com/questions/30151939
更新时间:2022-05-25 13:05
最满意答案
Express与模板无关,因为您可以选择任何您喜欢的模板引擎。 如果你想要更多HTML风格的模板,你可以使用ejs而不是Jade,例如:
// install ejs first npm install ejs
// app.js var express = require('express'); var app = express(); app.engine('html', require('ejs').renderFile); app.set('view engine', 'html'); app.get('/', function(req, res) { res.render('index', { name : 'World' }); }); app.listen(3012);
// ./views/index.html <h1>Hello <%= name %>!</h1>
// Output: <h1>Hello World!</h1>
Express is pretty template-agnostic, in that you can choose any templating engine you like. If you want more HTML-style templates, you could use ejs instead of Jade, for instance:
// install ejs first npm install ejs
// app.js var express = require('express'); var app = express(); app.engine('html', require('ejs').renderFile); app.set('view engine', 'html'); app.get('/', function(req, res) { res.render('index', { name : 'World' }); }); app.listen(3012);
// ./views/index.html <h1>Hello <%= name %>!</h1>
// Output: <h1>Hello World!</h1>
相关问答
更多-
如何在不使用Jade的情况下访问HTML上的Express参数?(How to access Express parameters on HTML without using Jade?)[2022-07-10]
我能够使用Consolidate渲染器而不是jade来解决这个问题: var cons = require('consolidate'); app.engine('html', cons.swig); app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'html'); 然后在js上访问它就像使用{{ varname }}一样简单,例如: var myParameters = "{{myParameters}}" ... -
如何配置express.js / jade来处理html文件?(How to configure express.js/jade to process html files?)[2022-04-01]
https://github.com/visionmedia/express/blob/master/examples/ejs/index.js app.engine('.html', require('jade').__express); https://github.com/visionmedia/express/blob/master/examples/ejs/index.js app.engine('.html', require('jade').__express); -
用于在前端和后端进行路由的Thumb规则: 后端路由:定义为获取/更新数据的路由。 前端路由:根据页面定义的路由 ,应显示给用户。 所以我们假设我们有两个页面,主页和个人资料页面 所以,前端路线将有两页 “/ home”loading home page“/ profile”loading profile 现在在每个页面上,您需要在html页面中显示一些数据,为此您创建路径: “/ getHomePageData”路由返回一些新闻提要(比方说)“/ getProfilePageData”路由返回一些用户相关 ...
-
Express与模板无关,因为您可以选择任何您喜欢的模板引擎。 如果你想要更多HTML风格的模板,你可以使用ejs而不是Jade,例如: // install ejs first npm install ejs // app.js var express = require('express'); var app = express(); app.engine('html', require('ejs').renderFile); app.set('view engine', 'html'); ...
-
如何在Express / Jade中获取“HTML 4.01 Strict”doctype?(How do I get the “HTML 4.01 Strict” doctype in Express/Jade?)[2022-03-19]
doctype strict 会给你: 我相信这是你能得到的最接近的。 PS:如果你正在迁移,为什么不改变,因为你还是要触摸它? doctype strict Will give you:静态JavaScript不在jade中显示(使用express / node.js)(static javascript not rendering in jade (with express/node.js))[2022-01-13]
你需要像这样传递来自控制器的脚本: app.get('/', function(req, res){ res.render('index', { title: 'Express', scripts: ['javascripts/script.js']}); }); 然后在layout.jade的头部: - each s in scripts script(src=s) you need to pass your script from the controller like that: ap ...我的猜测是你首先声明了全部路由: app.get('*', function(req, res) { res.sendFile(__dirname + '/public/index.html'); }); app.get('/login',function(req,res){ console.log("LOGIN GET") res.sendFile( path.join( __dirname, 'public', 'login.html' )); }); 由于/login匹配* ...从快速指南 : Express视图系统内置了对部分和集合的支持,这些部分和集合是代表文档片段的“小”视图。 例如,我们可以使用部分集合,而不是在视图中迭代以显示注释。 因此,当您在多个页面中为用户提供相同的“视图”时,将该视图存储在文件中并在任何地方“包含”它会更有用。 (干 - 不要重复自己) 另一个例子是当到处都有相同的布局时,你想要包括页面的其余部分(例如,你可以包括不同的页眉,页脚和正文,具体取决于页面)。 在Express示例中提供了Jade的一个很好的例子: https://github.com ...路由不使用Jade生成静态html文件的快速应用程序(Routes not working in an express app using Jade to generate static html files)[2020-12-19]
如果您要使用jade作为express中的视图引擎,则可以取消对jade文件的gulp编译。 这是一个不必要的步骤。 app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); 这些行告诉express在路由器中调用render()时使用jade。 在设置路由时,无论它们是root app.get('/', function(req, res){})还是其他东西 - 只需调用res.render('viewname')表示 ...Yeoman的最初目标是解决前端Web应用程序问题。 计划使用后端的意见工作流程,但目前有点麻烦 。 使用玉/样式是可能的 ,但有点难看。 所有这一切都将更容易使用Yeoman 1.0,它将更加可定制,并允许您使用您想要的任何grunt任务。 The initial goal of Yeoman was to tackle front-end web apps. Opinionated workflow with the back-end is planned, but is currently a bit ...相关文章
更多- Guava Doubles类-double基本类型的实用工具类
- ServletOutputStream cannot be resolved to a type
- function-Oceanus配置说明
- error C2668: 'M' : ambiguous call to overloaded function
- 两种js function 声明方式
- java double 保留两位小数
- Guava处理java int实用工具类-Ints类
- struts2 文件上传时,某次上传失败之后的所有上传都返回input,不跳到action
- input 框的自动提示框 错位
- HTTP Content-Type 内容类型详解
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)