Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 1

| accettato

Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 1

| accettato

Risposto
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...

oltre 7 anni fa | 0

| accettato

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

oltre 7 anni fa | 0

Risposto
"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...

oltre 7 anni fa | 4

| accettato

Risposto
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...

oltre 7 anni fa | 3

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

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 6

| accettato

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

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 4

Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 1

| accettato

Risposto
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; ...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 1

Risposto
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 -...

oltre 7 anni fa | 0

| accettato

Risposto
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(...

oltre 7 anni fa | 0

| accettato

Risposto
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 ...

oltre 7 anni fa | 1

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 1

| accettato

Risposto
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...

oltre 7 anni fa | 1

| accettato

Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 0

| accettato

Carica altro