Question


Window appears while code is runnig
Hello, I'm trying to create library with some |SimPowerSystem| blocks. When I use blocks from my library in |Simulink| model ...

6 years ago | 1 answer | 0

1

answer

Answered
How can I have a timed (15 minutes) output signal based on external trigger? I want to generate an output HIGH signal for 15 minutes based on a event detection impulse signal.
Hello, This is the model with standart Simulink blocks. Output from |Switch1| is the desired signal. The |Compare To Const...

6 years ago | 0

Answered
subs( ) command would not work
Hello, you should to reassign variable after substitution: A=subs(A,a,1);

6 years ago | 1

| accepted

Answered
How to find the determinant of 15 X 15 symbolic matrix?
Hi, I encountered the similar problem recently and I wrote a simple script for this task. It's designed for parallel computin...

6 years ago | 0

Answered
How to preview the fields of a struct array and to select just some of them.
Hi. You can get list of fields of structure by <https://www.mathworks.com/help/finance/fieldnames.html filednames> and adress...

6 years ago | 0

Answered
How to align two different sets of data whilst allowing a +- 10% range?
Hi)) %converting and renaming of variables t=table2array(table1); m=matrix2; %0.1 - range of choosing d=1+0.1*[...

6 years ago | 1

| accepted

Answered
Find the index of a string is structure
As i understand you right, the field textdata contains cell array with some strings. Let figure that |A| - structure. Then if y...

6 years ago | 1

| accepted

Answered
How to count continuous non zero elements whilst keeping the date of the first non-zero value
Hi. It's the simplest but not the shortest code for this problem. k=A(1,6)~=0; for i=1:size(A,1) if A(i,6)~=0&...

6 years ago | 1

| accepted

Answered
GA is not working...Function i have written separately calling in main program but not worked??
There are two version of code which are working but do not converge. First: xdata =[ 1 2 3 4 5 6] ; ydata=(1./(xd...

6 years ago | 0

| accepted

Answered
How can I put the values that I made in a for and if loop into a vector?
Code improvements: %Range of i for different calculation formulas FirstRange=[1:L_1]; SecondRange=[L_1:L]; %Create...

6 years ago | 0

Answered
merging two text files and generate 1000 copies of the new text (or dat) file
You should to read help for <https://www.mathworks.com/help/matlab/ref/sprintf.html sprintf> and <https://www.mathworks.com/help...

6 years ago | 1

| accepted

Answered
I can't open .fig files .m files nothing
You should to click on the "Browse" button and specify the path to your matlab program file which may be "C:\Program Files\MATL...

6 years ago | 0

| accepted

Answered
could anyone tell me how to have equal spacing of selected numbers with respect to axis.
You can compress data between 2 and 23 ticks roughly by %before plotting XData(XData>2&XData<23)=(XData(XData>2&XData<23)-...

6 years ago | 0

Answered
What does the ω_r represent in the Mechanical System Equation provided in the Permanent Magnet Synchronous Machine
Hello, That is also mechanical speed because that is equation of mechanical speed. Maybe in the full system of equations of S...

6 years ago | 0

Question


Error is occured when I changed version of Matlab
I have a lot of the code which work correctly in the Matlab 2013b but when I tried evaluate it on the machine with Matlab 2016a ...

6 years ago | 1 answer | 0

1

answer

Question


Does symbolic function inv() evaluated in multithread?
Hello, as noted here <https://www.mathworks.com/matlabcentral/answers/95958-which-matlab-functions-benefit-from-multithreaded...

6 years ago | 1 answer | 0

1

answer

Answered
How to repeat a code and build upon previous run's results?
Try this. I hope I understand you right. CostsMtx=[16,18,17,20,17;25,27,29,32,28;1.5,1.6,1.7,2,1.8;50,54,56,60,57;60,63,65...

7 years ago | 0

| accepted

Question


Accuracy in Simulink in transient process calculation
Hi, I try calculate current in scheme (figure below). <</matlabcentral/answers/uploaded_files/77571/1.png>> There are s...

7 years ago | 1 answer | 0

1

answer

Answered
What is the best way to rotate a line from a central point?
Hi, try this: %y, x - line coordinates %a, b - point coordinates %phi - rotating angle in radians counterclockwise ...

7 years ago | 0

Answered
Counting syllables in text from a txt file.
If i understand you right, try this. vowels={'A','I','O','U','E'}; hF=fopen('filename.txt'); %sum contains count of vow...

7 years ago | 0

Question


Error: subscript indices must either be real positive integers or logicals.
Hello, this part of function doesn't working and I don't have any idea why. hA=axes; hold on for i=1:length(Data) ...

7 years ago | 1 answer | 0

1

answer

Question


Analog VBA statement "with ... end with"
I need declare a lot (real many) fields of structure with long name. How i can do it without using loop? For example: Horr...

7 years ago | 0 answers | 0

0

answers

Answered
Infinite sum of a series
Try this. It seems you forgоt declare the |p|. syms z p r=2.5e-6/2; alpha= acosh(z/r); A= (2*sinh(((2*p)+1)*alp...

7 years ago | 0

Answered
data generation from given
Define |t|: t=[0:1e-3:1e-1]; Define |y|: y=10*sin(200*t)+20*cos(200*t.^2); Save data: %to txt fID = fopen('t...

7 years ago | 0

Answered
Modeling efflux time from a tank. Equation 11 in the attached document
I think it can be helpful. You have this function with |A, B, C, D| are known: fun = A * (dHdt)^2 + B * (dHdt)^1.75 + C *...

7 years ago | 0

Question


Access to parent object or problem with organize class
Hi, I need to attache some methods to the particular object |obj|. These methods stored to packages (folder with "+" in name)...

7 years ago | 1 answer | 0

1

answer