Respondida
Index in position 2 exceeds array bounds (must not exceed 1).
"Index in position 2 exceeds array bounds (must not exceed 1)." This error message means the code is trying to access a column ...

alrededor de 4 años hace | 0

Respondida
How to create a matrix with matrices as elements? where the matrix A contains symbolic variables
It may be useful to see the fact that, for matrices A, B, and C of the given sizes, the products C*B, C*A*B, C*A^2*B, etc., are ...

alrededor de 4 años hace | 0

| aceptada

Respondida
How can I print multiple texts that change using a for statement?
Create the text(s) you need once, before the loop, and then update them inside the loop. % t: 1-by-6 array of text objects % (...

alrededor de 4 años hace | 1

| aceptada

Respondida
is there a way to obtain F(-x) polynomial
Here's a way to do it by operating on the coefficients f rather than the symbolic F(x). Realize that , n even , n odd Theref...

alrededor de 4 años hace | 2

| aceptada

Respondida
I nee to write a code to solve a definite integral. The output format has to be fprintf.
syms x % f = -x.^3 + 3.x^2 - 2; % ^ this . should be * f = -x.^3 + 3*x^2 - 2; a=0; b=3; output = int(f, a, ...

más de 4 años hace | 1

Respondida
How to select consecutive rows at regular intervals?
% a matrix with 1000 rows and 5 columns M = (1:1000).'+(0:4) One way: A = M((20:50).'+(0:50:end-50),:); disp(A) Another w...

más de 4 años hace | 0

| aceptada

Respondida
when and how to use dot multiplication
"but is .* needed in my above q equation?" Yes. t is a vector, and q0, R, L, and C are all scalars. q0=10;R=60;L=9;C=0.0005; ...

más de 4 años hace | 1

| aceptada

Respondida
How many legs 100 cows have
n_legs_per_cow = 4; % one cow has 4 legs n_cows = 1000; % 1000 cows n_legs_total = n_cows*n_legs_per_cow

más de 4 años hace | 0

Respondida
Error message "Index exceeds the number of array elements. Index must not exceed 3"
fsp is the cell array, and fsp{1,1} is the vector contained in the first element (first cell) of fsp. You are taking the length...

más de 4 años hace | 0

| aceptada

Respondida
plotting title with multiple strings on one line
str_cell_array = {"abc\_def.h5" "ghi\_jkl.h5"}; str_title = strjoin(string(str_cell_array)," and ") title(str_title); figur...

más de 4 años hace | 0

| aceptada

Respondida
Applying one function in another function
CreateNeighbor() function sol = CreateRandomModel() sol = struct( ... 'sum_fburn_rand',rand(), ... 'fburn_rand',ra...

más de 4 años hace | 0

Respondida
May the number of decimal point be related with errors in matlab by using inpolygon and ismember functions?
"I am asking how it is possible?" MagnitudesOfEventsInAreaSource1{i} can have more than NumofeqsinArea1{i} elements if Catalog ...

más de 4 años hace | 0

| aceptada

Respondida
replace specific empty columns by 0 in cell MATLAB?
% reproduction of your cell array: C = repmat({NaN},7,15); C(1:4,11:15) = {0}; C(5:7,5:15) = {0}; C{1,1} = '0.x'; C{2,2} = ...

más de 4 años hace | 0

| aceptada

Respondida
interpreter with backlash underscores
The easiest way to fix this might be not to use an interpreter: subplot(2,1,1) xlim([-1 1]) set(gca(),'XTick',0,'XTickLabels'...

más de 4 años hace | 0

| aceptada

Respondida
How to disable figure pop up while initializing hggroup?
hggroup() creates an hggroup in the current axes in the current figure. If there is no current figure, then a new figure is cre...

más de 4 años hace | 0

Respondida
Use only a certain range of values for a function
truncated_z = z(t_z <= 3);

más de 4 años hace | 0

| aceptada

Respondida
Matching columns of arrays to fill up a corresponding empty column
load('OCV_new.mat') load('SoC_internal_new.mat') load('SOC.mat') It looks like SoC_internal_new is not values between 0 and 1...

más de 4 años hace | 1

Respondida
I can't seem to call an integral function inside of a plot that has any complexity. I need to plot outputs of a range of values for the integral.
You're calling int with two different sets of inputs and asking why one works and one doesn't, right? The line: plot(x,Wthr.P_...

más de 4 años hace | 0

Respondida
get xlabel,ylabel,title from premade plots
I don't think this will work for every premade plot, but it seems to work for plots created with rlocus H=tf([1],[1 1]); rlocu...

más de 4 años hace | 1

| aceptada

Respondida
I would like to mark the Minima of my colormap (scatter plot), because the Minima is not directly apparent.
% some random data for demonstration: ff_r = 100*rand(50,1); ff_g = 100*rand(50,1); saved_data = rand(50,1); plotted_data = ...

más de 4 años hace | 0

Respondida
Extracting data range from array problem
sampTurns = 5; ipArray=csvread('accel test drive 1.csv'); col1 = ipArray(:, 1); [peaks,peakIdx] = findpeaks(col1,'MinPeakDi...

más de 4 años hace | 0

| aceptada

Respondida
How to get column values using indexes
S = load('matlab.mat'); A = S.Dataset23; result = splitapply(@(x){x(:,1:4)},A,findgroups(A(:,5)))

más de 4 años hace | 0

Respondida
How to stop seperate axes plotting over the top of one anotner?
One way would be to plot into a new figure each time, instead of specifying to plot into figure 1 each time: x = [-10:1E-3:10];...

más de 4 años hace | 0

| aceptada

Respondida
limit the search for maximums to a specific region
Instead of inputting the entire array into findpeaks, you can simply input the part of the array you want to search, and then ad...

más de 4 años hace | 0

| aceptada

Respondida
Does somebody know how to plot this function?
Use tand rather than tan, because the argument 3*x is in degrees rather than radians. Increase the number of points to see the ...

más de 4 años hace | 1

| aceptada

Respondida
Unable to use a value of type cell as an index
Maybe the function compact_bbox defined below is close to what you have in mind. bbox_cell = { ... 'img1' [1 2 3] 'pothole...

más de 4 años hace | 0

| aceptada

Respondida
Legend of a plot out of table first row
I'm not sure where the legends are supposed to fit, but here you go: S = load('PegelpunktetimeseriesneuCopy'); Pegelpunktetime...

más de 4 años hace | 0

| aceptada

Respondida
Sort array of strings after criteria in the middle of each string
str = ["xer_cQwe" "po_bLo" "te_aUc"]; [~,idx] = sort(extractAfter(lower(str),'_')); sorted_str = str(idx)

más de 4 años hace | 0

| aceptada

Respondida
how to have a message that indicates me the experiment is done?
function Next_button_Callback(hObject, eventdata, handles) % hObject handle to Next_button (see GCBO) % eventdata reserved...

más de 4 años hace | 0

| aceptada

Respondida
How can I choose certain parameters to choose different ways to calculate the determinant?
Below is a function get_det, made by adapting your code, which takes a matrix as its first input and a character vector specifyi...

más de 4 años hace | 0

Cargar más