我想从包含虚数的数组中仅提取实数,我也想从数组中消除虚数.因此,从10个元素的数组中,其中5个是实数,5个是虚数,只能获得5个元素的数组,其中必须是实数元素.这在MATLAB中
编辑:
添加一个例子
input_array = [ 1, 1+i, -2+2*j, 3, -4, j ];
Run Code Online (Sandbox Code Playgroud)
期望的输出将是
output = [ 1, 3, -4 ];
Run Code Online (Sandbox Code Playgroud)
它只包含真实的元素input_array
.
我已经在我的Spring @controller中写了这个请求的映射,它接受请求和参数"tipoLista,numPagina"
@RequestMapping(value = "/admin/evento/approvatutti", params = "{tipoLista,numPagina}", method = RequestMethod.GET)
public ModelAndView approvaTuttiGliEventi(@RequestParam("tipoLista") String tipoLista, @RequestParam("numPagina") String numPagina, ModelAndView model) {
....bla bla ...bla...
}
Run Code Online (Sandbox Code Playgroud)
我打电话的时候 localhost:8084/context/admin/evento/approvatutti?tipoLista=valueOfParameter&numPagina=0
我收到错误代码400,请求错误.我已启用TRACE级别日志记录,但收到此消息:
Resolving exception from handler [null]: org.springframework.web.bind.UnsatisfiedServletRequestParameterException: Parameter conditions "{tipoLista,numPagina}" not met for actual request parameters: tipoLista={approvabili}, numPagina={0}
DEBUG - nseStatusExceptionResolver - Resolving exception from handler [null]: org.springframework.web.bind.UnsatisfiedServletRequestParameterException: Parameter conditions "{tipoLista,numPagina}" not met for actual request parameters: tipoLista={approvabili}, numPagina={0}
DEBUG - ltHandlerExceptionResolver - Resolving exception from handler [null]: org.springframework.web.bind.UnsatisfiedServletRequestParameterException: Parameter conditions "{tipoLista,numPagina}" …
Run Code Online (Sandbox Code Playgroud) 我有一个HTML文件:
<!DOCTYPE html>
<html>
<head>
<title>Insert</title>
<link rel="stylesheet" type="text/css" href="css/main.css">
<script type="text/javascript" src="js/jquery-1.10.1.js"></script>
<script type="text/javascript" src="js/controlla.js"></script>
</head>
<body>
<div id="insert">
<img src="css/images/logo.png" alt="Search Engine Logo" />
<input id="#textboxone" onkeyup="scova(event)" type="text"/>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我按顺序插入了脚本引用(第一个jquery,第二个是我的函数文件).在我的函数文件中,输入框中的onkeyup事件有函数scova(事件),不可能使用jQuery引用$
.
例如:
function scova(e) {
var valore = document.getElementById('#textboxone').value;
var valjquiro = $('#textboxone').val();
console.log('il valore di javascript: ' + valore);
console.log('il valore di jaquirro: '+valjquiro);
};
Run Code Online (Sandbox Code Playgroud)
在浏览器控制台中(在数字'test'之后),我得到:
il valore di javascript: test
il valore di jaquirro: undefined
Run Code Online (Sandbox Code Playgroud)
如何在我的函数文件中使用JQuery?如何$
在我的controlla.js中使用jquery的引用?