05 2024 档案
摘要:python豆瓣图书评论数据分析与可视化; import re from collections import Counter import requests from lxml import etree import pandas as pd import jieba import matplot
阅读全文
摘要:MATLAB最优化工具箱的使用 % 定义二次项系数矩阵 H 和线性项系数向量 f H = 2 * eye(3); % H 是单位矩阵的 2 倍,因为目标函数是 x_1^2 + x_2^2 + x_3^2 f = [0; 0; 0]; % f 为零向量 % 定义等式约束矩阵 Aeq 和向量 beq A
阅读全文
摘要:共轭梯度法程序设计 function [x, k] = fr_conjugate_gradient() % 初始猜测 x = [1; 2; 2; 2]; % 计算初始梯度 g = grad_f(x); % 初始搜索方向 d = -g; % 终止准则的容差 tol = 1e-6; % 最大迭代次数 m
阅读全文
摘要:Newton法程序设计 function [x_opt, f_opt, iterations] = newtons_method(f, gradient, hessian, x0, epsilon) x = x0; iterations = 0; while norm(gradient(x)) >
阅读全文
摘要:工程数学 黄金分割法 function [xmin, fmin, iter] = golds(func, a, b, tol) % func: 要优化的函数句柄 % a, b: 初始搜索区间的下界和上界 % tol: 精度要求 % 黄金分割比例 phi = (sqrt(5) - 1) / 2; c1
阅读全文
摘要:python 中国大学排名数据分析与可视化; import requests from bs4 import BeautifulSoup as bs import pandas as pd from matplotlib import pyplot as plt def get_rank(url):
阅读全文
摘要:Modulus=231-1=int.MaxValue Multiplier=75=16807 C=0 当显示过231-2个数之后,才可能重复。 编写一个方法,使用以上算法生成指定数目(比如1000个)的随机整数。 import java.util.Scanner; public class Rand
阅读全文
摘要:<!DOCTYPE html><html><head> <title>Login Page</title> <style> body { font-family: Arial, sans-serif; margin: 0; padding: 20px; } .container { max-widt
阅读全文
摘要:public class WarehouseInformation { private String itemno; //商品编号 private String itemname; //商品名称 private String suppliername; //供货商名称 private String
阅读全文
摘要:增代码 package com.example.test3_6;import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import android.widge
阅读全文
摘要:python设计实现电子算盘,并完成测试 from tkinter import * def initWindow(): rect = canvas.create_rectangle(25, 40, 450, 400, width=1) # 算盘边框 x0, y0, x1, y1 = 0, 0, 0
阅读全文
摘要:最速下降法程序设计 % 定义目标函数 f = @(x) (x(1)+x(2))^2 + 5*(x(3)-x(4))^2 + (x(2)-2*x(3))^4 + 10*(x(1)-x(4))^4; % 定义目标函数的梯度 grad_f = @(x) [2*(x(1)+x(2)) + 40*(x(1)-
阅读全文
摘要:public class WarehouseInformation { private String itemno; //商品编号 private String itemname; //商品名称 private String suppliername; //供货商名称 private String
阅读全文