Excel公式做同样为x =(B / N)*( - 地板(N / 2):地板(N / 2))在MATLAB [英] Excel formula to do the same as x=(b/N)*(-floor(N/2):floor(N/2)) in MATLAB
问题描述
我将我的MATLAB code到Excel文档,但有困难的跨越传输下面的公式。
I'm converting my MATLAB code into an excel document but are having difficulty transferring the following formula across.
x=(b/N)*(-floor(N/2):floor(N/2))
这意味着,如果例如B = 2和N = 5 结果将是:
Which if for example b =2 and N = 5 the results will be :
x = -0.8000 -0.4000 0 0.4000 0.8000
如果B = 2和N = 6的结果将是:
and if b = 2 and N =6 the results will be:
x = -1.0000 -0.6667 -0.3333 0 0.3333 0.6667 1.0000
请注意:如果N为奇数中有×N个元素,当n为偶数有以x N + 1个元素
Note: If N is odd there are N elements in x, if N is even there are N+1 elements in x.
任何想法如何在Excel中写呢?
Any ideas for how to write it within Excel?
推荐答案
这答案是如下的意见,我的另一个<一href="http://stackoverflow.com/questions/21093856/is-the-a-similar-command-within-excel-that-performs-the-same-as-the-floor-comm/21093893?noredirect=1#comment31848753_21093893">answer.
This answer is follows from comments to my another answer.
这是一个非常大的数组公式。选择 F3:F19
,在公式栏和$ P $输入公式PSS <大骨节病> CTRL 骨节病> + <大骨节病> SHIFT 骨节病> + <大骨节病> ENTER 骨节病>对其进行评估。
(假设你的b在 A1
电池,你在 C4ñ
细胞。
It's a really big array formula. Select F3:F19
, enter formula in the formula bar and press CTRL+SHIFT+ENTER to evaluate it.
(suppose your b in A1
cell, your N in C4
cell.
=IFERROR(INDEX(($A$1/$C$4)*INT(($C$4-(ROW(INDIRECT($C$4 & ":" & 3* $C$4-1))-$C$4))/2),SMALL(IF(MATCH(($A$1/$C$4)*INT(($C$4-(ROW(INDIRECT($C$4 & ":" & 3* $C$4-1))-$C$4))/2),($A$1/$C$4)*INT(($C$4-(ROW(INDIRECT($C$4 & ":" & 3* $C$4-1))-$C$4))/2),0)=ROW(INDIRECT("1:" & ROWS(($A$1/$C$4)*INT(($C$4-(ROW(INDIRECT($C$4 & ":" & 3* $C$4-1))-$C$4))/2)))),MATCH(($A$1/$C$4)*INT(($C$4-(ROW(INDIRECT($C$4 & ":" & 3* $C$4-1))-$C$4))/2),($A$1/$C$4)*INT(($C$4-(ROW(INDIRECT($C$4 & ":" & 3* $C$4-1))-$C$4))/2),0),""),ROW(IDIRECT("1:" & ROWS(($A$1/$C$4)*INT(($C$4-(ROW(INDIRECT($C$4 & ":" & 3* $C$4-1))-$C$4))/2)))))),"")
下面是我的测试工作簿
这篇关于Excel公式做同样为x =(B / N)*( - 地板(N / 2):地板(N / 2))在MATLAB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!