摘要: 去除图框刻度 找到预处理函数如下图: 去除图框刻度代码: axes(handles.axes1);cla reset;box on; set(gca, 'XTickLabel', [], 'YTickLabel', []); axes(handles.axes2);cla reset;box on; 阅读全文
posted @ 2023-03-09 17:21 wtws 阅读(617) 评论(0) 推荐(0) 编辑
摘要: 打开 首先在命令行窗口输入guide 根据所需设计自己需要的按钮以及显示框 编辑按钮,建立其与坐标的关联。右键选择“查看回调”——>“callback”,即进入文件编辑界面 阅读全文
posted @ 2023-03-09 15:45 wtws 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 类和对象是: 类:是共同特征的描述(设计图); 对象:是真实存在的具体实例。 //属性(成员变量) String name; double price; //行为(方法) public void start(){ System.out.println(name + "价格是:" + price + 阅读全文
posted @ 2022-01-31 20:40 wtws 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 作用:可以立即跳出并结束当前方法的执行; return关键字单独使用可以放在任何方法中。 public static void main(String[] args) { System.out.println("开始"); chu(1,0); System.out.println("结束"); } 阅读全文
posted @ 2022-01-30 20:49 wtws 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 方法重载:同一个类中,出现多个方法名称相同,但是形参列表是不同的,那么这些方法就是重载方法。 调用方法的时候,会通过参数的不同来区分调用的是哪个方法。 案例:开发武器系统,功能需求如下: 可以默认发一枚武器。 可以指定地区发射一枚武器。 可以指定地区发射多枚武器。 public static voi 阅读全文
posted @ 2022-01-30 20:38 wtws 阅读(98) 评论(0) 推荐(0) 编辑
摘要: int[] arr1 = {1, 2, 3}; int[] arr2 = {1, 2, 3}; System.out.println(compare(arr1,arr2)); } public static boolean compare(int[] arr1, int[] arr2){ if (a 阅读全文
posted @ 2022-01-13 20:14 wtws 阅读(25) 评论(0) 推荐(0) 编辑
摘要: //3、定义数组、调用方法 int[] arr = {11, 22, 33, 44, 55}; int index = seachIndex(arr,55); System.out.println("你查询的数据索引是:" + index); } //1、定义一个方法:参数接收数组,要查询的数据,返 阅读全文
posted @ 2022-01-13 20:01 wtws 阅读(128) 评论(0) 推荐(0) 编辑
摘要: public static void main(String[] args) { //打印整型数组的内容 int[] ids = {11, 22, 33, 44} ; printArray(ids); System.out.println(" "); int [] id = {}; printArr 阅读全文
posted @ 2022-01-13 19:46 wtws 阅读(56) 评论(0) 推荐(0) 编辑
摘要: Java的参数传递机制:值传递 在传输实参给方法的形参的时候,并不是传输实参变量本身,而是传输实参变量中存储的值,这就是值传递。 注意: 实参:如在方法内部定义的变量。 形参:如在定义方法时,“()”中所声明的参数。 public static void main(String[] args) { 阅读全文
posted @ 2022-01-13 19:28 wtws 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 方法没有调用的时候,在方法区中的字码文件中存放 方法被调用时,需要进入到栈内存中运行 public static void main(String[] args) { study(); } public static void eat(){ System.out.println("吃饭"); } p 阅读全文
posted @ 2022-01-13 19:08 wtws 阅读(27) 评论(0) 推荐(0) 编辑