| 5 | 1/1 | 返回列表 |
| 查看: 846 | 回復(fù): 2 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
tonifcty金蟲 (初入文壇)
|
[求助]
幫忙把下面matlab m文件寫成mathematica程序
|
||
|
就是一個(gè)對應(yīng)的找位置的小程序,但是本人不會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 |
木蟲 (小有名氣)
|
樓主是自暴自棄了嗎……選了一個(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}]] |

新蟲 (小有名氣)
|
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 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 一志愿蘇州大學(xué)材料求調(diào)劑,總分315(英一) +3 | sbdksD 2026-03-19 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 294求調(diào)劑材料與化工專碩 +14 | 陌の森林 2026-03-18 | 14/700 |
|
|
[考研] 梁成偉老師課題組歡迎你的加入 +9 | 一鴨鴨喲 2026-03-14 | 11/550 |
|
|
[考博] 東華理工大學(xué)化材專業(yè)26屆碩士博士申請 +8 | zlingli 2026-03-13 | 8/400 |
|
|
[考研] 一志愿西安交通大學(xué)材料工程專業(yè) 282分求調(diào)劑 +5 | 楓橋ZL 2026-03-18 | 7/350 |
|
|
[考研] 085600材料與化工調(diào)劑 324分 +10 | llllkkkhh 2026-03-18 | 12/600 |
|
|
[考研] 一志愿福大288有機(jī)化學(xué),求調(diào)劑 +3 | 小木蟲200408204 2026-03-18 | 3/150 |
|
|
[考研] 330求調(diào)劑 +3 | 小材化本科 2026-03-18 | 3/150 |
|
|
[考研] 344求調(diào)劑 +6 | knight344 2026-03-16 | 7/350 |
|
|
[考研] 【同濟(jì)軟件】軟件(085405)考研求調(diào)劑 +3 | 2026eternal 2026-03-18 | 3/150 |
|
|
[考研] 297求調(diào)劑 +8 | 戲精丹丹丹 2026-03-17 | 8/400 |
|
|
[考研] 278求調(diào)劑 +5 | 煙火先于春 2026-03-17 | 5/250 |
|
|
[考研] 085601求調(diào)劑 +4 | Du.11 2026-03-16 | 4/200 |
|
|
[考研] 材料與化工專碩調(diào)劑 +5 | heming3743 2026-03-16 | 5/250 |
|
|
[考研] 283求調(diào)劑 +3 | 聽風(fēng)就是雨; 2026-03-16 | 3/150 |
|
|
[基金申請]
今年的國基金是打分制嗎?
50+3
|
zhanghaozhu 2026-03-14 | 3/150 |
|
|
[考研] 304求調(diào)劑 +4 | ahbd 2026-03-14 | 4/200 |
|
|
[考研] 321求調(diào)劑 +5 | 大米飯! 2026-03-15 | 5/250 |
|
|
[考研] 0703化學(xué)調(diào)劑 290分有科研經(jīng)歷,論文在投 +7 | 膩膩gk 2026-03-14 | 7/350 |
|
|
[考研] 中科大材料專碩319求調(diào)劑 +3 | 孟鑫材料 2026-03-13 | 3/150 |
|