Beantwortet
Filling in a polygon
Hi, it depends on the order you enter the single points. See this: x8=[0, 2, 2.5, 3.5, 5, 4, 5, 3, 1, 1.5]; y8=[2, 2, 0, 2...

mehr als 7 Jahre vor | 0

Beantwortet
BVP4C code not giving an output & boundary condition issues.
Hi, your function does not return anything. Try: sol = main; subplot(2,1,1) plot(sol.x,sol.y) grid subplot(2,1,2) plot(so...

mehr als 7 Jahre vor | 0

Beantwortet
None linear least square fit for complex model
Hi, have a read here: https://de.mathworks.com/help/releases/R2015a/curvefit/fit.html?searchHighlight=fit#bto2vuv-11 There is...

mehr als 7 Jahre vor | 0

Beantwortet
Plot error, vector must be same length
Hi, make t same size then the vectors you want to plot: % h = 0.08; nmax = 800; wx = zeros(1, nmax); wy = wx; wz = wx; t...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
Is't possible to plot a one curve with two Y-axises for this case
Hi, just scale them: A=[0.5778 40.0000 152.8081 0.5867 41.0000 154.7064 0.5956 42.0000 156.5817 0.6045...

mehr als 7 Jahre vor | 0

Beantwortet
How do i fix this error?
Hi, the Display option is only avaiable if the fitting method is nonlinear least squares: https://de.mathworks.com/help/curvef...

mehr als 7 Jahre vor | 0

Beantwortet
Unable to find explicit solution for "solve"
Hi, solve numeric: % Values for constants - I took some fantasy values... Isc = 0.1; Is = 1; q = 2; Rs = 0.0135; Rsh = -2...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
how can i a create a struct?
Hi, the best way to learn Matlab is reading the excellent documentation. Have a read here: https://de.mathworks.com/help/matla...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Produce an excel file with major and minor column name
https://de.mathworks.com/matlabcentral/answers/337613-how-to-merge-cells-in-excel

mehr als 7 Jahre vor | 0

Beantwortet
"the scope of variable spans multiple functions matlab"
Hi, yes, it is due to the nested functions. It is one possible way to avoid global variables. There is nothing wrong with it. T...

mehr als 7 Jahre vor | 4

| akzeptiert

Beantwortet
Average of two closed curves
Hi, try: % Calculate Parts to 90° angle1 = linspace(0,pi/4,180)'; % Radius of circle = length of square = 1 r = 1; % Calcu...

mehr als 7 Jahre vor | 3

Beantwortet
Error when using ezplot
syms a(x,y) a = x^3 + y^3 - 3*x*y == 0; ezplot(lhs(a),[-2, 2, -3, 2])

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Help me with indexing please?
Hi, as suggested in the comments read the documentation. Here is a small example which is near by your problem. Try to understa...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Finite Elements Method creating global stiffness matrix
Hi, you overwrite k every time. Im sure it could be done much easier - but here s a quick solution without any code optimizatio...

mehr als 7 Jahre vor | 6

| akzeptiert

Beantwortet
distance between two points
dist = sqrt((A(:,1)-B(:,1)).^2 + (A(:,2)-B(:,2)).^2 + (A(:,3)-B(:,3)).^2);

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
sound generation using MATLAB
Hi, think about your sampling frequency. Can it really work to sample a signal of 100kHz with a sample rate of 24kHz? Or do you...

mehr als 7 Jahre vor | 4

Beantwortet
Importing .csv files and generating surf plots for each
Hi, have a read here: https://de.mathworks.com/help/matlab/ref/uigetfile.html#mw_8fd45c03-ae42-4f5a-9595-297c77185283 This ex...

mehr als 7 Jahre vor | 0

Beantwortet
Resonance frequency in enclosures
Hi, you can use this function: function Frequencia_Table = Frequencia(v,lx,ly,lz) % Building the array of values nx = [zeros...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
GWO structure help, please rewrite the code help
NumAgents = 7; maxiters = 2000; lb = [0 2]; ub = [1 5]; dim = 2; fobj = @my_function_that_expects_a_vector_of_2_values; ...

mehr als 7 Jahre vor | 0

Beantwortet
Error using sym/subs Too many input arguments. Error in mx_model (line 176) f = subs(f, cup,cu,0);
Hi, as the error message says, there are too much input arguments. The correct syntax for subs is: subs(eqn,old,new) The code...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
what does "X = X./max(max(X))" means?>
Hi, the dot means an elementwise operation. See here: https://de.mathworks.com/help/matlab/ref/rdivide.html For more informat...

mehr als 7 Jahre vor | 1

Beantwortet
Extract all numbers from a matrix that also contains NaN into a single vector
A = [1 2 3; NaN -2 0; NaN 5 -8] result = A(~isnan(A)) gives. A = 1 2 3 NaN -2 0 NaN 5 -...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Finding unique values from arrays of different sizes
Hi, transpose them: A = [1; 2; 3]; B = [3; 4; 5]; C = [5; 6]; D = [8; 9]; % works_not = unique([A B C D]) works = unique(...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Error: Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using Levenberg-Marquardt algorithm instead.
Hi, add this line before you call fsolve: opts = optimoptions(@fsolve,'Algorithm', 'levenberg-marquardt'); Then in your call ...

mehr als 7 Jahre vor | 1

Beantwortet
how to maximize the ratio between two areas
Hi, sorry for the late reply. I attached 2 files: Optm_Geo_new.m which is an adapted version of your original file and (if i m...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Efficient sparse matrix operation
Hi, if you precalculate the sum and then calculate you can save some time: N = sum(S,2); S./N; I tried using sparse matrices...

mehr als 7 Jahre vor | 0

Beantwortet
matlab out of memory error when multiplying 2 matrix
Hi, consider: X = ones(3,120744); result_1 = X*X'; % --> Result = 3 x 3 Matrix (72 Byte) result_2 = X'*X; % --> Result = 1...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
transfer fuction representation needed
Hi, this is a compact way to express 1 transfer function with 3 inputs and convert it to a state space representation.You can f...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
HOW TO CREATE THİS MATRİX
Hi, beginning from R2016b you can use: A = [0:99] + [0:99]' or - with respect to Madhans comment for prior releases: B = bsx...

mehr als 7 Jahre vor | 0

Beantwortet
Finding a maximum using gamultobj tool
Hi, all optimizers in Matlab try ti find minimum of functions. If you want to maximize you simply minimize the negative functio...

mehr als 7 Jahre vor | 0

| akzeptiert

Mehr laden