| 查看: 803 | 回复: 2 | |||
[求助]
帮忙把下面matlab m文件写成mathematica程序
|
|
就是一个对应的找位置的小程序,但是本人不会mathematica,求指导,多谢 前面赋值的部分搞成输入那种 function [Plate,Col,Row]=findplace(x,y,z) %x:row,y:column,z:slide %microarray column and row to microplate column and row %set parameter i=8;%microplate row number j=10;%microplate column number Ne=5; %Number of needle length=4.5e4;%length of microarry width=2.0e4;%width of microarry stepx=250; stepy=250; %calculate R=fix(width/stepy); C=fix(length/stepx);% Total numbers of rows and columns of microarray subcolumn=fix(C/Ne); % numbers of columns for each needle array array=ceil(y/subcolumn); time=R*(y-1-(array-1)*subcolumn)+x+(z-1)*R*subcolumn;% the number of spots Plate=ceil(time/(i*j/Ne)); a=rem(time,(i*j/Ne)); if a==0 Row=i; Col=array+1+Ne; elseif a<=i Row=a; Col=array+1; else Row=a-i; Col=array+1+Ne; end |
» 猜你喜欢
职称评审没过,求安慰
已经有55人回复
最近几年招的学生写论文不引自己组发的文章
已经有5人回复
26申博自荐
已经有3人回复
A期刊撤稿
已经有4人回复
» 本主题相关价值贴推荐,对您同样有帮助:
matlab程序求助指教
已经有4人回复
mathematica对导入数据的操作
已经有3人回复
matlab的m文件关联问题
已经有17人回复
matlab M文件 给规定参数设个边界
已经有7人回复
冈萨雷斯数字图像处理MATLAB版m代码源码
已经有276人回复
matlab如何生成不同的随机数
已经有9人回复
linux下怎么编译matlab m文件
已经有9人回复
Matlab(或者Mathematica) 如何进行复杂函数的二重积分?
已经有6人回复
matlab数据拟合问题求助
已经有7人回复
matlab m文件运行出错
已经有4人回复
Matlab中如何调用M文件作图
已经有9人回复
matlab中M文件的调用
已经有12人回复
电脑没安装matlab,如何运行M文件
已经有3人回复
【求助】MATLAB、Mathematica和Maple这三大数学软件的优缺点
已经有41人回复
【讨论】关于一个m文件中函数调用及画图问题
已经有7人回复
【求助】mathematica 可以函数调用吗?
已经有4人回复
【求助】求助:matlab下求y=x(e^abs(x)+1.3)的逆函数
已经有9人回复
落叶撼秋风
新虫 (小有名气)
- 应助: 1 (幼儿园)
- 金币: 4928.1
- 散金: 101
- 帖子: 249
- 在线: 117.7小时
- 虫号: 1461705
- 注册: 2011-10-26
- 性别: GG
- 专业: 物理学I
【答案】应助回帖
★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
tonifcty: 金币+50, ★★★★★最佳答案 2013-11-01 18:36:24
感谢参与,应助指数 +1
tonifcty: 金币+50, ★★★★★最佳答案 2013-11-01 18:36:24
|
function [Plate,Col,Row]=findplace(x,y,z) %x:row,y:column,z:slide %microarray column and row to microplate column and row %set parameter i=8;%microplate row number j=10;%microplate column number Ne=5; %Number of needle length=4.5e4;%length of microarry width=2.0e4;%width of microarry stepx=250; stepy=250; %calculate R=fix(width/stepy); C=fix(length/stepx);% Total numbers of rows and columns of microarray subcolumn=fix(C/Ne); % numbers of columns for each needle array array=ceil(y/subcolumn); time=R*(y-1-(array-1)*subcolumn)+x+(z-1)*R*subcolumn;% the number of spots Plate=ceil(time/(i*j/Ne)); a=rem(time,(i*j/Ne)); if a==0 Row=i; Col=array+1+Ne; elseif a<=i Row=a; Col=array+1; else Row=a-i; Col=array+1+Ne; end |
2楼2013-11-01 18:28:46
|
楼主是自暴自弃了吗……选了一个完全无关的答案。如果只是翻译一下是很容易的: findplace[x_, y_, z_] := With[{i = 8, j = 10, Ne = 5, length = 4.5 10^4, width = 2.0 10^4, stepx = 250, stepy = 250}, Module[{r, c, a, subcolumn, array, time, plate, row, col}, r = IntegerPart@(width/stepy); c = IntegerPart@(length/stepx); subcolumn = IntegerPart@(c/Ne); array = Ceiling@(y/subcolumn); time = r*(y - 1 - (array - 1)*subcolumn) + x + (z - 1)*r*subcolumn; plate = Ceiling@(time/(i*j/Ne)); a = Mod[time, (i*j/Ne)]; Which[ a == 0, row = i; col = array + 1 + Ne, a <= i, row = a; col = array + 1, True, row = a - i; col = array + 1 + Ne]; {plate, col, row}]] |

3楼2014-07-04 12:19:32













回复此楼