摘要: argsparse是python的命令行解析的标准模块,内置于python,不需要安装。这个库可以让我们直接在命令行中就可以向程序中传入参数并让程序运行,不需要打开来输入参数。 import argparse parser = argparse.ArgumentParser(description= 阅读全文
posted @ 2021-08-20 11:34 Hugh996 阅读(47) 评论(0) 推荐(0)
摘要: 引用 一维数组 A(x) 二维数组 A(x,y) 函数 find find(x) i=find(x) [i,j]=find(x) 找 x 中非 0 find(x,k)或 find(x,k,'first') i=find(x,k) [i,j]=find(x,k) 找 x 中前 k 个中非 0 find 阅读全文
posted @ 2021-08-14 23:14 Hugh996 阅读(100) 评论(0) 推荐(0)
摘要: 自有矩阵函数 zeros(2,3) 2x3全零矩阵 eye(3,3) 3x3 单位矩阵 | 函数 | 用处 | | : : | : : | | zeros | 全零矩阵 | | eye | 单位矩阵 | | ones | 全一矩阵 | | rand | 随机矩阵(均匀分布) | | randn | 阅读全文
posted @ 2021-08-14 22:03 Hugh996 阅读(78) 评论(0) 推荐(0)
摘要: 条件控制语句 if elseif else end switch x case 1 case 2 otherwise end 循环语句 for i=1:n end while 条件 end 调试 try catch end pause pause 暂停 pause(n)暂停 n 秒 阅读全文
posted @ 2021-08-14 21:50 Hugh996 阅读(62) 评论(0) 推荐(0)
摘要: 别名(句柄) \(F=@cos\) cos 是别名就是 F 调用 1.三个输入变量,三个变量 function [x,y,z]=fun(theta,phi,rho) 函数以 function 开始 函数以end结束 自带函数 disp()相当于 cout 阅读全文
posted @ 2021-08-14 21:15 Hugh996 阅读(209) 评论(0) 推荐(0)
摘要: 引用 引用中间的一部分 U="qwertyuiop" U(1:2:5) 引用 1 到 5范围内字符,步长为 2。 连接 W=[U,U] 将 UU 连接起来 阅读全文
posted @ 2021-08-14 18:53 Hugh996 阅读(103) 评论(0) 推荐(0)
摘要: 类型 范围 说明 Int8,uint8 \(-2^7~2^7-1\),\(0~2^8-1\) Int16,uint16 \(-2^15~2^15-1\),\(0~2^16-1\) Int32,uint32 \(-2^31~2^31-1\),\(0~2^32-1\) int64,uint64 \(-2 阅读全文
posted @ 2021-08-14 18:46 Hugh996 阅读(80) 评论(0) 推荐(0)
摘要: 常用命令 命令 Shell 用处 cd cd dir ls clc cls load xxx xxx 执行 xxx ! 调用 DOS path pwd save 标点含义 标点 作用 【】 矩阵 {} 数组 % 注释 ... 续行 ! 调用系统命令 阅读全文
posted @ 2021-08-14 17:48 Hugh996 阅读(71) 评论(0) 推荐(0)
摘要: ``` include include using namespace std; struct node { int len,num; string w; }a[25]; int cmp(node a,node b) { if(a.len!=b.len) return a.len b.len; // 阅读全文
posted @ 2018-10-02 00:02 Hugh996 阅读(219) 评论(0) 推荐(0)
摘要: 注意输入输出的格式! P1056 排座椅 include include include using namespace std; int map[10005][10005]; struct node { int num,w; }lie[10005],han[10005]; int anslie[1 阅读全文
posted @ 2018-10-01 23:32 Hugh996 阅读(161) 评论(0) 推荐(0)