Answered
Printing a variable in a fprintf
This can be done in a relatively simple way. VTL="5kV"; fprintf('Initial Value is: %s circuit values\n', VTL) ... % Your cal...

23 dagen ago | 0

Answered
How to create a equally distributed batting order for little league baseball team
Here is how it can be generated for 10 times within a loop: for ii=1:10 A(ii,:) =randperm(10, 10); end

23 dagen ago | 0

Answered
How to make a contour plot with incomplete z data?
As I understood your question correctly, you'd need to employ something like this one to get controurf(Z) from the values of X a...

23 dagen ago | 0

Answered
How to create a equally distributed batting order for little league baseball team
Use randperm() to generate the orders, e.g.: ORDER = randperm(10,10)

23 dagen ago | 0

Answered
What do I have to fix the plot to make it work?
It is working ok now, but your formulations have some problems. Thus, the calculated results (xI, SI, PI) are not OK. clc; clea...

23 dagen ago | 1

Answered
solving system of non linear equations using fsolve by converting symbolic expressions
Here is the solution: syms c d e x; R=(1+(1-c-d-e+c*x^2+d*x^3+e*x^4))*(2*c+6*d*x+12*e*x^2) + (2*c*x+3*d*x^2+4*e*x^3)^2 -(1-c-d...

23 dagen ago | 0

| accepted

Answered
loop do add easy part
Cris already gave a very good answer to your question, BUT if you want to get it via loop only as an exercise. Here is how it ca...

23 dagen ago | 0

Answered
Issues with Horzcat for defining a variable as a row vector
You had better use this vectorized approach instead of a loop based calculation of norm values, i.e. norme, normr, normutilde: ...

23 dagen ago | 0

| accepted

Answered
Import data from CSV file by Import Tool or textscan
Use readmatrix() that would import all numerical data in a matrix form.

24 dagen ago | 0

Answered
How can I give each values of torque for value of RPM as an input?
Yes, indeed this can be done in Simulink and matlab. For Simulink modelling, you can employ the following block for input data: ...

24 dagen ago | 0

Answered
How to plot transcendental equation?
Here is how it can be solved and plotted: clc clearvars close all nf= 1.3; ns=1.5; nc=1; rho=1; hf=1.5; lambda = 100:35...

24 dagen ago | 0

| accepted

Answered
How to copy variable titles from one table and copy them in another table
You should employ renamevars(), e.g.: clearvars; clc T = table([3; 4; 2; 1; -1;]); T.A = {'C1'; 'D1'; 'E1'; 'F1'; 'H1'}; T.B...

24 dagen ago | 0

Answered
Convert tablet to matrix
You can consider to convert it into cell array and matrix arrays, e.g.: CLS = table2array(T(:,1)) % Cell Array HRS = table2...

24 dagen ago | 0

Answered
Phase angle calculation confusion
Note that the phase shift and phase angle are NOT the same thing. Above, you are computing the phase shift (pa) that is not a Ph...

25 dagen ago | 0

Answered
Creating image from cell array of states and years
Your data array type is not quite clear from your provided snapshot. If your data is as shown in the snapshot and then imagesc()...

25 dagen ago | 0

Answered
how can i automatically save the image after every shot ?
Here is the completed part of the code: ... global Snapshot; % Edited/corrected part for image collection for ii = 1:10 ...

25 dagen ago | 0

| accepted

Answered
Creating image from cell array of states and years
The error is originated from your data X that does not present appropriate data format for imagesc(). Could you pl., upload your...

25 dagen ago | 0

Answered
Fit curve to a model problem
There are a couple of other fit model fcns of the toolbox that can be employed with your exercise. They are nlinfit() and nlinto...

25 dagen ago | 0

Answered
how can i automatically save the image after every shot ?
... % Edit this part for ii = 1:10 imgName = [MyFolder, '\ImageReal_', num2str(ii), '.jpg'] end

25 dagen ago | 0

Answered
Loop script, changes colours and save each image as jpeg
Is this what you want to achieve: r=1:50; for ii=1:numel(r) Tree(r(ii)) end function Tree(r) figure('Position',[50,5...

25 dagen ago | 0

Answered
The fminsearch is not working for my matlab but it is for others, is there something wrong with my settings and how can I change it?
You may have another function file called FindError with different number of input args that might be overshaddowing this on. ...

25 dagen ago | 0

Answered
i have to get combine correct figure
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % EXAMPLE 3-3: Calculating the Voltage Losses for a Polarization Curve % UnitSystem SI %%%...

26 dagen ago | 0

Answered
Why does solving the heat equation with MATLAB (pdepe) yield a completely different result than the Heisler chart (analytical solution)?
In fact, in your matlab code solution, you have obtained the solution in the two corners T = 27.019 C (about) that is approx equ...

26 dagen ago | 0

Answered
i have to get combine correct figure
Here is how you can attain all three plots in one fig.: ... plot(i,V_out,'b-o', i, V_act, 'r-d', i, V_ohmic, 'g--s') disp(V...

26 dagen ago | 0

Answered
Fourier series plot as sums of sines and cosines
This can be done in a few different ways, such as vectorization, [for .. end] and [while .. end] loops. E.g.: clc; clearvars; c...

26 dagen ago | 0

| accepted

Answered
How to measure the size of the red blots in the image?
In your exercise, starting with the image pixel values impixel() and employining logical indexing would be a good solution. Then...

26 dagen ago | 0

Answered
Retreiving equations from a matrix
Here is the corrected code: clearvars syms T22 T32 T33 T23 %% Note how your equations are set up B =[50, ...

26 dagen ago | 0

Answered
Conversion to struct from double is not possible.
Use elementwise operation: ... xp=xp+xmin.*d(i,:); % Elementwise end

26 dagen ago | 0

Answered
Conversion to struct from double is not possible.
The error is coming from your problem exercise fcn @funkcja1. That would be helpful to see funkcja1 to give you proper hints h...

26 dagen ago | 0

Answered
How to remove background color from an image?
D = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/784688/image.png'); subplot(211) imshow(D) I = D; ...

28 dagen ago | 0

| accepted

Load more