% Read a few books data = readmatrix('.xlsx'); A = data(:, 3); % forest age dem = data(:, 4); % DEM TNx = data(:, 5); % TNx p = data(:, 6); % P B = data(:, 1); % DBH % Define a new model, including the original nonlinear functions, term sum, mercury, and the seven laws of water from variables. new_model_with_extensions = @(b, X) exp(3.259 - 16.799 ./ X(:,1)) + b(1) * X(:,2) + b(2) * X(:,3) + b(3) * X(:,4); % Prepare yourself to measure your troops in front of the battle. X = [A, dem, TNx, p]; % Take forest age, DEM,TNx and precipitation as their own measuring instruments. % It was only at the beginning that the number of people in custody began to be guessed. initial_guess_for_new_model = [0.1, 0.1, 0.1]; % Take it, take it as the top, take it as a courtesy % Sets nonlinear fitting options options = statset('nlinfit'); options.MaxIter = 9999; % The maximum number of intersecting substitutions % The form of imitation is different. fit_result = fitnlm(X, B, new_model_with_extensions, initial_guess_for_new_model, 'Options', options); % Explicit and combined disp(fit_result); % The visual adjustment remained unchanged, so I got ready to do things. figure; % The law of normalization is surrounded. TNx_normalized = (TNx - min(TNx)) / (max(TNx) - min(TNx)); % Sets the size range of the point dem_sizes = 5 + 50 * (dem - min(dem)) / (max(dem) - min(dem)); dem_sizes(dem_sizes > 100) = 100; % Since scatter3 limiting, we use loops to each point. hold on; for i = 1:length(A) scatter3(A(i), p(i), B(i), dem_sizes(i), TNx_normalized(i), 'filled'); end hold off; colormap(jet); colorbar; clim([0 1]); % Set the axis tag and title. xlabel('Average forest age A'); ylabel('Precipitation County p'); zlabel('Diameter at Breast Height B'); title('The average forest age, precipitation, Kong, Mingbei Prefecture, Hezhou, Jiaoyu Prefecture and other places are ready to use various colours to indicate the theory of geography, and the size and scale are all represented by silver taels.)');