在matlab中从excel中获取数据(fetching data from excel in matlab)
我试图从excel中获取一个超过17500行的列。现在的问题是,当我在MATLAB中调用它时,它不会给我所有数据的整个矩阵。 它从中间的某个地方获取数据。
现在真正的问题是我必须在列中添加4个数字并获得平均值,将其保存在另一列中并继续下一组连续的数字并再次重复直到结束。我怎么能在MATLAB中这样做。请发布。帮助我解决这个问题,因为我只是一个菜鸟。 谢谢。
到目前为止,我所做的是这样的:
clc g=xlsread('Data.xlsx',1,'E1:E17500'); x=1; for i = 1:(17500/4) %as steps has to be stepped at 4 since we need avg of 4 y{i}=((g{x}+g{x+1}+g{x+2}+g{x+3})/4); x=x+4; end xlswrite('Data.xlsx', y, 1, 'F1:F4375');
I am trying to fetch a column from excel with rows more than 17500. Now problem is that when i call it in MATLAB , it does not gives me whole matrix with all data. it fetches data from somewhere in middle.
Now the real problem is that i have to add up 4 numbers in the column and get average , save it in another column and proceed to next consecutive set of numbers and repeat again till the end..How could i do that in MATLAB .Please help me solve this problem as i am just a rookie. Thank you.
so far i have done is this:
clc g=xlsread('Data.xlsx',1,'E1:E17500'); x=1; for i = 1:(17500/4) %as steps has to be stepped at 4 since we need avg of 4 y{i}=((g{x}+g{x+1}+g{x+2}+g{x+3})/4); x=x+4; end xlswrite('Data.xlsx', y, 1, 'F1:F4375');
原文:https://stackoverflow.com/questions/31347488
最满意答案
我想你正在寻找这个。 使用html,css和jquery的淡入菜单
$("#menu li").hover( function () { $(this).children("ul").finish().fadeIn(); }, function () { $(this).children("ul").finish().delay(1000).fadeOut(); });
I think you are looking for this. Fade-in menu using html,css and jquery
$("#menu li").hover( function () { $(this).children("ul").finish().fadeIn(); }, function () { $(this).children("ul").finish().delay(1000).fadeOut(); });
相关问答
更多-
基于这个网站 编辑-1 添加了功能,以便用户可以指定动画持续时间(@Marzian评论) 你可以试试这个: function fadeIn(el, time) { el.style.opacity = 0; var last = +new Date(); var tick = function() { el.style.opacity = +el.style.opacity + (new Date() - last) / time; last = +new Date(); ...
-
Javascript扩展文本淡入(Javascript expand text fade-in)[2023-09-21]
我强烈推荐使用GreenSock JS作为处理任何HTML DOM元素动画的非常简单的方法。 JavaScript标记或文件中非常简单但有效的动画代码行的示例如下: TweenLite.from("#myTextElement", 1, {scaleX: 0.1, scaleY: 0.1, alpha: 0}); 上面的示例 - 超过一秒 - 动画#myTextElement(可以是大多数ID为“myTextElement”的元素),从10%到现有比例CSS值的比例,以及从0%的alpha到现有的不透明度 ... -
您可以使用:before和:after元素。 (例如width:100vh为width:100vh的div)在屏幕左侧显示一个渐变,右侧显示一个渐变。 content:''; height: 100%; width: 15%; display:block; position: absolute; left: 0; background: rgba(255,255,255,1); background: -moz-linear-gradient(left, rgba(255,2 ...
-
Javascript:淡入淡出(Javascript: Fade in and out)[2022-02-10]
加 到您的HTML并添加此JavaScript代码: $("#sent").fadeOut("slow"); 在这一行之后: document.getElementById("sent").innerHTML="Sent!"; Add