回答済み
How can I make this program accept input 'value' as only a positive number except for the case 1(where i would like to have both negative and positive numbers as input)?
if a == 1 R = value*5; else if value<0 disp('Value must be positive') else R = v...

約6年 前 | 0

回答済み
How to convert array of chars examples: '09:56am' or '09:56pm' to number?
As Stephen points out, it is not quite clear what you want to do once you find a string with 'am' or 'pm', but this may get you ...

約6年 前 | 0

回答済み
Disk out of an arc
Is this what you want? R = 5; x = linspace(R*cos(theta),R,100); y = sqrt (R^2 - x.*x); x = [0,x]; y = [0,y]; ...

約6年 前 | 1

| 採用済み

回答済み
How to set up two ODE functions in matlab
You should collect your unknowns P and N in a vector x, and define a function for the right-hand side of your ODE system, someth...

約6年 前 | 2

回答済み
How can i plot the basic fitting line through the origin (0,0)?
You want to find the slope a of the line <</matlabcentral/answers/uploaded_files/111728/ax.JPG>> that best fits your data...

約6年 前 | 1

回答済み
How to solve "Subscripted assignment dimension mismatch" error ?
dec2bin(n,m) returns the binary representation of n as a string of m characters, with leading '0'-s as needed. When you assign a...

約6年 前 | 0

回答済み
How to create the Gas deviation-factor chart for natural gases from Standing and Katz
plot(Ppr,Z); xlabel('Ppr'); ylabel('Z'); legends = cell(10,1); for i = 1:10; legends{i} = sprintf('Tpr = %3...

約6年 前 | 0

| 採用済み

回答済み
How can i make my integral more efficient?
I agree that the time gain from my first answer is too small to be of much help in your case. I have tested an alternative appro...

約6年 前 | 0

| 採用済み

回答済み
How can i make my integral more efficient?
Using logical indexing instead of find will be faster: relevant = p >= dataset2(d+k,9) & p <= dataset2(d+k,12); dataset2...

約6年 前 | 0

回答済み
Can I optimise a dynamic model where the objective function is equal just a variable?
What do you mean by 100% full? Is this defined by the hydrogen mass in the car or by the pressure? Either way, you will nee...

約6年 前 | 1

| 採用済み

回答済み
I have intraday data in minutes, how can I convert to daily culmulative return
I have now modified the code to use the text file you supplied as input. The format was significantly different from the origina...

約6年 前 | 0

回答済み
barplot with both plot next to each other?
Adapted from <https://www.mathworks.com/help/matlab/ref/bar.html>: y = [5,4;6,5.5;3.8,3]; bar(y) set(gca,'XTickLabel'...

約6年 前 | 0

回答済み
Finding important data in txt file
In your case you want to parse all lines containing just numbers into an array (which you may later want to split by e.g.: Px = ...

約6年 前 | 0

| 採用済み

回答済み
Get closest x value to y value from a cumulative histogram
If you have access to a toolbox with the prctile function (I don't), that will probably do the job. Alternatively, try this...

約6年 前 | 0

| 採用済み

回答済み
Exporting values from Matlab into a Formatted Text File
Here is one way to do it. Note that I collect all the output values in a cell array of strings. First, a sample input file,...

約6年 前 | 0

回答済み
Figure legend: how to prevent entries from showing?
h = plot(....); legend(h([1,4,7]),'original','proposed','proposed with optimisation')

約6年 前 | 0

回答済み
How to extract values from tables in the workspace and then plot them in a specific way
Is this what you want? x = [20,30,40]; for i = 1:16; for j = 1:8; figure; plot(x,[Table1(i,...

約6年 前 | 1

| 採用済み

回答済み
How to find the maximum point of a line on a plot with multiple lines?
[mx,i] = max(x(:,2)); tmx = t(i); hold on; plot(tmx,mx,'*r')

約6年 前 | 1

| 採用済み

回答済み
How do I plot a point at the x intercept on this graph?
Let U be a function of r only and find the solution to U(r) = 0: e=1; sigma=0.154; r=linspace(0.154,1,100); U = @(...

約6年 前 | 1

回答済み
Run code through multiple excel files
You could try something like this: Names = {'participantNumber';'Ar';'Br';'Xr';'Yr';'RRr';'ZRr';'SBr';... 'SLr';...

約6年 前 | 0

| 採用済み

回答済み
How to Compare datetimes with milisecs?
s = 30; % The accuracy you desire (in seconds) close_enough = abs(u1200lab(1,1)-u1300processo(1,1)) < 1/24/3600*s

約6年 前 | 0

回答済み
Generate synthetic data (or probability distribution object) from user-defined distribution function
Drawing random samples from a given Probability Distribution is excellently explained by Carson Chow at <https://sciencehouse.wo...

6年以上 前 | 1

| 採用済み

回答済み
I want to plot a set of points satisfying certain condition. Although, there are many points in this set satisfying the given condition, the code I am using plots only the last point. Anyone can help me to plot all these points?
You should specify a marker, since otherwise Matlab tries to plot a line between points. With only one point for each plot stat...

6年以上 前 | 0

回答済み
I'm looking for getting the matlab codes for soving nonlinear differential equations? These equations are from a research paper on HIV AIDS.
Matlab has several functions for integrating systems of differential equation. Type doc ode45 for more information. ...

6年以上 前 | 1

| 採用済み

回答済み
from acceleration to velocity: problem of integration
I have followed this question, hoping that somebody with better signal processing skills that myself would come up with an elega...

6年以上 前 | 1

回答済み
I am trying to solve a non linear simultaneous equation using NR method.The program does not converges.I know the exact solution and if the initial value is set to exact value then the program converges in one step.
First: Your script parameter_function_matrix.m is a bit confusing, with your exceedingly long expressions. It would be easier t...

6年以上 前 | 0

| 採用済み

回答済み
How to use ODE solver for a coupled second order ODE?
Convert to four first-order ODEs in x, u,y,v, where u = x', v = y'. The equations are then: A*u' + B*v' = -C*v - D^y + ...

6年以上 前 | 0

回答済み
Extracting column and specific sorted row data from a large text file
fid = fopen('FILE_MATLAB.txt'); Cell_number = []; Slope_Angle = []; Z = []; P = []; for i = 1:4 % Skip heade...

6年以上 前 | 1

回答済み
Create the objective function for fmincon solver using for loop
You are right that the problem lies with the line FUN = @(x) Afun(x) + FUN(x); This defines a recursive function, where ...

6年以上 前 | 1

さらに読み込む