| 24小時(shí)熱門(mén)版塊排行榜 |
| 3 | 1/1 | 返回列表 |
| 查看: 844 | 回復(fù): 2 | ||
tonifcty金蟲(chóng) (初入文壇)
|
[求助]
幫忙把下面matlab m文件寫(xiě)成mathematica程序
|
|
就是一個(gè)對(duì)應(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 |
新蟲(chóng) (小有名氣)
|
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 |
木蟲(chóng) (小有名氣)
|
樓主是自暴自棄了嗎……選了一個(gè)完全無(wú)關(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ā)表 | |
|---|---|---|---|---|
|
[考研] 0703化學(xué)調(diào)劑,求各位老師收留 +10 | 秋有木北 2026-03-14 | 10/500 |
|
|---|---|---|---|---|
|
[考研] 一志愿西南交大,求調(diào)劑 +4 | 材化逐夢(mèng)人 2026-03-18 | 4/200 |
|
|
[考研] 299求調(diào)劑 +5 | △小透明* 2026-03-17 | 5/250 |
|
|
[考研] 0703化學(xué)求調(diào)劑 總分331 +3 | ZY-05 2026-03-13 | 3/150 |
|
|
[考研] 材料,紡織,生物(0856、0710),化學(xué)招生啦 +3 | Eember. 2026-03-17 | 9/450 |
|
|
[考研] 308求調(diào)劑 +4 | 是Lupa啊 2026-03-16 | 4/200 |
|
|
[考研] 材料專(zhuān)碩326求調(diào)劑 +6 | 墨煜姒莘 2026-03-15 | 7/350 |
|
|
[考研] 一志愿,福州大學(xué)材料專(zhuān)碩339分求調(diào)劑 +3 | 木子momo青爭(zhēng) 2026-03-15 | 3/150 |
|
|
[考研] 304求調(diào)劑 +4 | ahbd 2026-03-14 | 4/200 |
|
|
[考研] 一志愿華中師范071000,325求調(diào)劑 +6 | RuitingC 2026-03-12 | 6/300 |
|
|
[考研] 求老師收留調(diào)劑 +4 | jiang姜66 2026-03-14 | 5/250 |
|
|
[考研] 本科南京大學(xué)一志愿川大藥學(xué)327 +3 | 麥田耕者 2026-03-14 | 3/150 |
|
|
[考研] 中科大材料專(zhuān)碩319求調(diào)劑 +3 | 孟鑫材料 2026-03-13 | 3/150 |
|
|
[考研] 招收0805(材料)調(diào)劑 +3 | 18595523086 2026-03-13 | 3/150 |
|
|
[考研] 求材料調(diào)劑 085600英一數(shù)二總分302 前三科235 精通機(jī)器學(xué)習(xí) 一志愿哈工大 +4 | 林yaxin 2026-03-12 | 4/200 |
|
|
[考研] 311求調(diào)劑 +3 | 冬十三 2026-03-13 | 3/150 |
|
|
[碩博家園] 085600 260分求調(diào)劑 +3 | 天空還下雨么 2026-03-13 | 5/250 |
|
|
[考研] 求調(diào)劑 +5 | 一定有學(xué)上- 2026-03-12 | 5/250 |
|
|
[考研] 求調(diào)劑 +3 | 程雨杭 2026-03-12 | 3/150 |
|
|
[考研] 085600材料與化工 309分請(qǐng)求調(diào)劑 +7 | dtdxzxx 2026-03-12 | 8/400 |
|