| 3 | 1/1 | 返回列表 |
| 查看: 845 | 回復(fù): 2 | |||
tonifcty金蟲 (初入文壇)
|
[求助]
幫忙把下面matlab m文件寫成mathematica程序
|
|
就是一個(gè)對應(yīng)的找位置的小程序,但是本人不會(huì)mathematica,求指導(dǎo),多謝 前面賦值的部分搞成輸入那種 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 |
新蟲 (小有名氣)
|
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 |
木蟲 (小有名氣)
|
樓主是自暴自棄了嗎……選了一個(gè)完全無關(guān)的答案。如果只是翻譯一下是很容易的: 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 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 0817 化學(xué)工程 299分求調(diào)劑 有科研經(jīng)歷 有二區(qū)文章 +10 | rare12345 2026-03-18 | 10/500 |
|
|---|---|---|---|---|
|
[考研] 一志愿福大288有機(jī)化學(xué),求調(diào)劑 +3 | 小木蟲200408204 2026-03-18 | 3/150 |
|
|
[考研] 一志愿中海洋材料工程專碩330分求調(diào)劑 +7 | 小材化本科 2026-03-18 | 7/350 |
|
|
[考研] 267一志愿南京工業(yè)大學(xué)0817化工求調(diào)劑 +10 | SUICHILD 2026-03-12 | 10/500 |
|
|
[考研] 304求調(diào)劑 +6 | 司空. 2026-03-18 | 6/300 |
|
|
[考研] 材料工程專碩調(diào)劑 +5 | 204818@lcx 2026-03-17 | 6/300 |
|
|
[考研] 328求調(diào)劑,英語六級551,有科研經(jīng)歷 +3 | 生物工程調(diào)劑 2026-03-17 | 7/350 |
|
|
[考研] 材料專業(yè)求調(diào)劑 +5 | hanamiko 2026-03-18 | 5/250 |
|
|
[考研] 【同濟(jì)軟件】軟件(085405)考研求調(diào)劑 +3 | 2026eternal 2026-03-18 | 3/150 |
|
|
[考研] 化學(xué)工程321分求調(diào)劑 +15 | 大米飯! 2026-03-15 | 18/900 |
|
|
[考研] 材料,紡織,生物(0856、0710),化學(xué)招生啦 +3 | Eember. 2026-03-17 | 9/450 |
|
|
[考研] 生物學(xué)071000 329分求調(diào)劑 +3 | 我愛生物生物愛?/a> 2026-03-17 | 3/150 |
|
|
[考研] 326求調(diào)劑 +5 | 上岸的小葡 2026-03-15 | 6/300 |
|
|
[考研] 290求調(diào)劑 +6 | 孔志浩 2026-03-12 | 11/550 |
|
|
[考研] 一志愿,福州大學(xué)材料專碩339分求調(diào)劑 +3 | 木子momo青爭 2026-03-15 | 3/150 |
|
|
[考研] 0854控制工程 359求調(diào)劑 可跨專業(yè) +3 | 626776879 2026-03-14 | 9/450 |
|
|
[考研] 0703化學(xué)調(diào)劑 290分有科研經(jīng)歷,論文在投 +7 | 膩膩gk 2026-03-14 | 7/350 |
|
|
[考研] 0856求調(diào)劑 +3 | 劉夢微 2026-03-15 | 3/150 |
|
|
[考研] 327求調(diào)劑 +6 | 拾光任染 2026-03-15 | 11/550 |
|
|
[考研] 中科大材料與化工319求調(diào)劑 +3 | 孟鑫材料 2026-03-14 | 3/150 |
|