上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 73 下一页
摘要: 1、x=rand(2)生成2*2的随机数组 2、rand(m,n) m行n列 3、使用 zeros 函数创建一个包含 6 行 3 列 (6×3) 的全零矩阵。 4、如何知道现有矩阵的大小? 使用 size 函数。 size(x) 也可以使用一行代码创建与现有矩阵大小相同的矩阵。 rand(size( 阅读全文
posted @ 2020-08-13 12:39 Tomorrow1126 阅读(1116) 评论(0) 推荐(0) 编辑
摘要: 1、x=[3 9] 行向量 x=[3;9] 列向量 2、x^2 表示x的二次方 4、创建等间距向量 (1)x=1:4 相当于创建: x=[1 2 3 4 ] (2) 运算符使用默认的间距 1,但是您可以指定您自己的间距,如下所示。 x = 20:2:26 x = 20 22 24 26 (3)如果您 阅读全文
posted @ 2020-08-13 12:06 Tomorrow1126 阅读(608) 评论(0) 推荐(0) 编辑
摘要: 1、save +文件名 保存 例如: save datafile 保存成datafile.mat 2、使用 load 命令从 MAT 文件加载变量。 例如:load datafile 3、直接输入变量名可以直接显示变量的值 4、clear 函数清理工作区。clc 命令清理命令行窗口。 5、π用pi来 阅读全文
posted @ 2020-08-13 11:53 Tomorrow1126 阅读(231) 评论(0) 推荐(0) 编辑
摘要: a、tic和toc函数 这两个函数一般配合使用,tic表示计时的开始,toc表示计时的结束。 格式如: tic 任意表达式 toc t=toc b、cputime函数 cputime函数返回从调用该函数起所用的总的Cpu时间,单位以秒计算。 格式如: t=cputime; 任意表达式或者程序 e=c 阅读全文
posted @ 2020-08-11 21:23 Tomorrow1126 阅读(845) 评论(0) 推荐(0) 编辑
摘要: 一般vector不会超时 其他的可以用数组来模拟一下。 阅读全文
posted @ 2020-08-11 14:47 Tomorrow1126 阅读(186) 评论(0) 推荐(0) 编辑
摘要: __int64与long long 都是在32位平台开始使用bai的du64位整数的数据类型,在存储方式和使用方式上没有区别。两者的区zhi别在于,它们命名的发起人不同,支持的平台不同。 long long这个数据类型,是UNIX平台发起并支持的,而__int64是微软从win95(VC6)开始发起 阅读全文
posted @ 2020-08-11 14:41 Tomorrow1126 阅读(489) 评论(0) 推荐(0) 编辑
摘要: 一开始用queue超时了,可能是因为太慢了? queue方法: #include<cstdio> #include<iostream> #include<string> #include<cstring> #include<cmath> #include<stdlib.h> #include<alg 阅读全文
posted @ 2020-08-11 14:40 Tomorrow1126 阅读(111) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio> #include<iostream> #include<string> #include<cstring> #include<cmath> #include<stdlib.h> #include<algorithm> #include<vector> #includ 阅读全文
posted @ 2020-08-11 13:22 Tomorrow1126 阅读(94) 评论(0) 推荐(0) 编辑
摘要: bool visit[100]; memset(visit,false,sizeof(visit)); 阅读全文
posted @ 2020-08-11 13:16 Tomorrow1126 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 还没测试代码能不能通过。 主要思想: 首先把第一个柱子上N-1个移动到第三个上,然后最大的移动到第二个柱子上,然后N-1个再移动回到第一个,最大的移动到第三个,然后剩下N-1移动到第三个。 也就是 2+hannuota(n-1)*3。 N=1时是2次。剩下的递归求解。 之前用的int错了!!! 改成 阅读全文
posted @ 2020-08-10 12:53 Tomorrow1126 阅读(88) 评论(0) 推荐(0) 编辑
上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 73 下一页