Respondida
How to find a number but if it repeats immediately after, take the first value.
Here is an easy solution to your exercise: A = [0 5 0 5 5 0 0 0 5 5 5 5 5 0 0 0]; IND = find(A==5); C = A(IND(1:5)); Good lu...

más de 5 años hace | 0

Respondida
Plotting Isotherms on a contour plot
Here is a simple solution (plot part only) to your exercise: pcolor(rot90(rot90(x)), rot90(rot90(y)), T2), shading interp Good...

más de 5 años hace | 0

Respondida
Error with equation using sym/subsindex
In your code, there are a few confusions and flaws. You've define: f(A) = x.*tan(A)-(g./(2.*V.^2.*((cos(A)).^2))).* x.^2-y; f a...

más de 5 años hace | 0

Respondida
Error - "Simulink cannot propagate the variable-size mode"
Your MATLAB fcn blck file should have: function y = fcn(u) y = 0.02559*exp(u).*sin(2*u)-0.059734*exp(u).*cos(2*u);

más de 5 años hace | 0

Respondida
Issue with plotting variables with ranges
Here is how to start this: N = 200; % Number of data points to be genearted and calculated to plot xc=linspace(0...

más de 5 años hace | 0

| aceptada

Respondida
Basic Sampling question involving sampling rate and graphing
Your code has a problem with the end time value to take into calculations and display of the calculated data points. Here are ...

más de 5 años hace | 0

Respondida
Shortest path constrained to use specific nodes
Here is an easy solution: shortestpath(G, 1,3) % Shortest path between 1 and 3 Good luck.

más de 5 años hace | 0

Respondida
Open the .dat file in Matlab
You can employ a few built in data import functions of MATLAB to read your data and then save them in *.mat file. E.g: FN = 'MY...

más de 5 años hace | 3

Respondida
Using Diff() with NaN values
You can substitute all 'nan' values with 0's by locating them via isnan() and then substituting.

más de 5 años hace | 0

Respondida
How to feed additional variables into fsolve function
Here is a combined and a bit simplified solution: options = optimoptions('fsolve','Display','iter'); x0 = [150,0.045,7.5]; dv...

más de 5 años hace | 0

Respondida
How would I solve for the two unknowns with 3 equations
Here is the simple solution: SOL = solve(mr*(hfgr + (.68*cpgr* (t2-t1)))==mw*(hfgw + (.68*cpgw *(T1-T2))), F*Ao*Uo*LMTD==mr*(hf...

más de 5 años hace | 0

| aceptada

Respondida
error too many input arguments
Here is the corrected one (more efficient in calculation part): kk=1:24000; xx0(kk)=exp(1i*kk*pi/16); N=20; for ii=1:N p...

más de 5 años hace | 0

Respondida
Doubt in a product erro
Here is a small correction to obtain the correct answers in your exercise: t1 = 0:0.01:300; N = 2; % Number of ...

más de 5 años hace | 1

| aceptada

Respondida
Error in equation/variables
% You need to perform elementwise operation. Since Theta = [0, 120] Theta^2 % must be Theta.^2 . % missing before / o...

más de 5 años hace | 1

Respondida
How to use trapz for area under curve
The answer to your exercise is realtively simple: IND = find(Ua2<=20); AREA = trapz(Ua2(IND), reva2(IND)); fprintf('The area ...

más de 5 años hace | 1

| aceptada

Respondida
How to redirect function output arguments to a cell array
If this is the case, then you'd need to convert the outputs into cell array after acquiring the outputs from the function - sill...

más de 5 años hace | 0

Respondida
Saving output of for loop after each iteration (for a function)
Here is the corrected code of yours: y = 0:0.05:1; u= 2*y-(2*y.^3)+y.^4; a = 0:0.01:1; b = 4000; C=zeros(numel(a),numel(u)...

más de 5 años hace | 0

Respondida
How to redirect function output arguments to a cell array
One of the easy and quick solution to your exercise is alike the following: OUT = sillyFunction(X); % The output is a cell arr...

más de 5 años hace | 0

Respondida
How can analyse respones in MATLAB live screen?
With *.mlx editor, you can insert a slider to assign the magnitude value of y0, w1, w2, and set the value range of t. The rest i...

más de 5 años hace | 0

Respondida
Subplot on a saved figure only working for one subplot
I presume that you have a loop before "if... end" operations, correct? You should put "hold all" command after your "plot()" co...

más de 5 años hace | 0

Respondida
convert Hexadecimal to decimal in text file
Use reshape(): reshape(DECd, 4, 6) % Because your converted data is 24 - by -1 Good luck

más de 5 años hace | 0

| aceptada

Respondida
Extract and Analyse data from multiple excel files and sheets
Please go over these hints given by mathworks staff for data import from MS Excel: http://www.mathworks.com/help/matlab/matlab...

más de 5 años hace | 0

| aceptada

Respondida
Plot function y=(sin(x))/x for pi/100<=x<=10pi using increments of pi/100
% Start rightaway by defining the variable x and compute it x = pi/100:pi/100:10*pi; y = sin(x)./x; % plot plot(x, y) % Yo...

más de 5 años hace | 0

| aceptada

Respondida
Using ode45 to solve a Non linear ode with multiple variables?
Here is the corrected completed code: tic; tspan = 0:0.0033:100; a=55*(pi/180); b=0; k0 = [a; b]; [t,k] = ode45(@pend_k,...

más de 5 años hace | 0

| aceptada

Respondida
solving BVP using anonymous function
Your four variables a, b, Ta and Tb are not defined. Pre-define their values just before your anonymous function is defined. ...

más de 5 años hace | 0

Respondida
convert Hexadecimal to decimal in text file
Here is the one of the easy solutions: FN = 'HD.txt'; % File name % Open the data file to process: ID = fopen(FN); % Scan ...

más de 5 años hace | 0

Respondida
how to uplad and process multiply images
It is doable, but your image file names need to be in a sequential order, e.g.: Image1.jpg, Image2.jpg, ...., etc., OR IM_01....

más de 5 años hace | 0

Respondida
Displaying different strings on a graph based on an input of a function handle
If I understood your question correctly, you're trying to display your found best fit model on the plot surface, correct? If th...

más de 5 años hace | 0

Respondida
How to extract specific parts of a matrix
Logical indexing would be an easy and fast solution.

más de 5 años hace | 0

Pregunta


legend() has an issue with 'Selected' or 'selected'
The command legend() has an issue with 'Selected' as a legend name. E.g.: t = -13:13; A = t*2-3*t; B = A(A>0); figure plo...

más de 5 años hace | 1 respuesta | 0

1

respuesta

Cargar más