上一页 1 ··· 110 111 112 113 114 115 116 117 118 ··· 178 下一页
  2020年8月2日
摘要: x = linspace(0,pi); y1 = cos(x); plot(x,y1) hold on y2 = cos(2*x); plot(x,y2) y3 = cos(3*x); plot(x,y3) y4 = cos(4*x); plot(x,y4) hold off legend({'co 阅读全文
posted @ 2020-08-02 15:54 一杯明月 阅读(3108) 评论(0) 推荐(0)
摘要: 转换函数的问题:谁把谁转换成什么? 设计一个class的对象a,a可不可以转换成另外一种类型,或者另外一种类型可不可以转换成a 注解: int/int 会丢失精度(网友弹幕),如5/2=2. 5/2输出的是2. cout << (double)5 / 2 << endl; 这样输出的就是2.5(相当 阅读全文
posted @ 2020-08-02 11:13 一杯明月 阅读(353) 评论(0) 推荐(0)
  2020年8月1日
摘要: Generate 10,000 random numbers and create a histogram. The histogramfunction automatically chooses an appropriate number of bins to cover the range of 阅读全文
posted @ 2020-08-01 18:54 一杯明月 阅读(13838) 评论(0) 推荐(0)
摘要: figure('name','test','NumberTitle','off'); figure(1);hold on;set(gcf,'color','w'); % 这句是设置背景色为白色 阅读全文
posted @ 2020-08-01 18:01 一杯明月 阅读(429) 评论(2) 推荐(0)
摘要: matlab中矩阵的点乘就是对应元素相乘: a=[1 2 3;4 5 6] a = 1 2 3 4 5 6 b=a b = 1 2 3 4 5 6 a.*b ans = 1 4 9 16 25 36 阅读全文
posted @ 2020-08-01 11:28 一杯明月 阅读(4455) 评论(0) 推荐(0)
  2020年7月31日
摘要: #include<iostream> #include<unistd.h> using namespace std; int main() { cout<<"hello,world!"<<endl; return 0; pause; } 阅读全文
posted @ 2020-07-31 17:05 一杯明月 阅读(742) 评论(0) 推荐(0)
  2020年7月30日
摘要: 泛型编程(Generic Programming)和面向对象编程(Object-Oriented Programming)虽然分属于不同思维,但是它们正式C++的技术主线,所以本课程也讨论模板(template). 深入探索面向对象之继承关系(inheritance)所形成的对象模型(Object 阅读全文
posted @ 2020-07-30 23:00 一杯明月 阅读(153) 评论(0) 推荐(0)
  2020年7月29日
摘要: Inheritance(继承) with virtual functions(虚函数) non-virtual函数(不是虚函数):你希望drived class(子类)不要重新定义(overide,覆盖)。 virtual(虚)函数:你希望devired class(子类)最好去重新定义(overi 阅读全文
posted @ 2020-07-29 09:52 一杯明月 阅读(302) 评论(0) 推荐(1)
  2020年7月27日
摘要: 在C中,指针主要用来操作字符数组。 在C中,指针是重点。 什么是指针 指针的定义和初始化 指针操作 指针就是一个对象的地址。 阅读全文
posted @ 2020-07-27 17:24 一杯明月 阅读(132) 评论(0) 推荐(0)
摘要: 序言: 字面值常量是和变量相对的。 int a; a就是整型变量。 2是字面值常量。 举例: main.cpp: #include<iostream> using namespace std; int main() { int a = 1; int b = 2; cout <<"a + b="<< 阅读全文
posted @ 2020-07-27 16:33 一杯明月 阅读(168) 评论(0) 推荐(0)
上一页 1 ··· 110 111 112 113 114 115 116 117 118 ··· 178 下一页