五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

北太天元畫矩陣非零元的腳本

2023-06-12 02:28 作者:盧朓  | 我要投稿

% 北太天元的腳本函數(shù) draw_matrix.m 的

% 內(nèi)容如下, 與視頻相比修正了一點,原來的行列搞顛倒了

% 修改后一個3x10的矩陣的非零元畫出如下


% 北太天元把矩陣中的非零元的位置畫出來

% A [input] 布爾矩陣或者double 矩陣,如果|A(i,j)| > eps 則填充紅色

%??非零元使用 |A(i,j)|>eps 來判定的

%例如

%clf

%close all

%clear all


%m = 3;

%n = 3;

%A = zeros(m,n);


%A(2,2) = 1.0;

%draw_matrix(A)


%

function??ok = draw_matrix(A)

???clf

???close all

???hold on;


???if isa(A,'double')

??????B?= abs(A) > eps;

???elseif islogical(A)

??????B = A;

???else

??????ok = false;

??????error("A需要是布爾矩陣或者double矩陣");

???end


???[m,n] = size(A);


???for i=1:m

??????for j=1:n

?????????if(B(i,j))??????

????????????tiao_rectangle('Position',[j-1 i-1 1 1], 'Curvature', 0, 'FaceColor', [1,0,0], 'EdgeColor','m', 'LineWidth', 1);

?????????else


????????????tiao_rectangle('Position',[j-1 i-1 1 1], 'Curvature', 0, 'FaceColor', [0.9,0.9,0.9], 'EdgeColor','m', 'LineWidth', 1);

?????????end

??????end

???end

???axis square

???hold off

???ok = true;

end


%Position[input]??總是寫成"Position"

%pos[input] 是一個1x4的矩陣 pos =[ 左下x, 左下y, 寬度, 高度]

%cur[input]?0 表示直角舉行

%fc[input]?填充的顏色

%lw[input] 邊的寬度

function ok = tiao_rectangle(Position, pos, Curvature, curv, FaceColor, fc, EdgeColor, ec, LineWidth, lw)

?len = length(curv);

?if (len >= 2)

???horz_curv = curv(1);

???vert_curv = curv(2);

?elseif (len == 1)

???horz_curv = curv(1);

???vert_curv = curv(1);

?else

???horz_curv = 0;

???vert_curv = 0;

?end


?lux = pos(1); luy =pos(2);

?width = pos(3); height = pos(4);



?if ( abs(horz_curv)<0.1 && abs(vert_curv) <0.1 )

???fx = [lux, lux+width, lux+width, lux, lux];

???fy = [luy, luy, luy+height, luy+height, luy];

?else

???n = 15;

???p = pi / 2 * [0 : n] / n;

???c = curv .* pos(3:4) / 2;

???cx = c(1) * sin (p) - c(1);

???cy = c(2) * cos (p) - c(2);

???fx = [pos(1) - cx(n+1:-1:1), pos(1) + pos(3) + cx, ...

?????pos(1) + pos(3) + cx(n+1:-1:1), pos(1) - cx, pos(1), pos(1)-cx(n+1)];

???fy = [pos(2) - cy(n+1:-1:1), pos(2) - cy, ...

?????pos(2) + pos(4) + cy(n+1:-1:1), ...

?????pos(2) + pos(4) + cy, pos(2) + c(2),?pos(2)-cy(n+1)];

?end


?fill(fx, fy, fc, EdgeColor, ec, LineWidth, lw)

?ok = true;

end



北太天元畫矩陣非零元的腳本的評論 (共 條)

分享到微博請遵守國家法律
临夏县| 泉州市| 大化| 贡嘎县| 扬州市| 温州市| 盐城市| 清徐县| 阳原县| 大丰市| 金川县| 彭阳县| 阳高县| 如皋市| 太原市| 五原县| 双鸭山市| 昭苏县| 西乌| 靖远县| 遂溪县| 西乡县| 大方县| 灵山县| 公安县| 灌云县| 平度市| 澎湖县| 同仁县| 惠水县| 武汉市| 苏州市| 赤水市| 白玉县| 获嘉县| 沁水县| 宾川县| 滁州市| 阳江市| 卓资县| 芦山县|