Answered
How we can do the matrix and vector in vector form?
I've demonstrated 2 methods here using reshape and colon, : . Refer to the documentation pages linked for more info. Note that ...

2 years ago | 1

Answered
統計値のまとめ方
Read the data using readmatrix, calculate the quantities using max, min, mean and std. Store the results in a table with an app...

2 years ago | 0

| accepted

Answered
I am trying to get my answer to Display but it wont let me
The function disp accepts only 1 input argument. If you want to display the roots and the text in the same line, you will have...

2 years ago | 0

| accepted

Answered
Changing the name of a variable changes the results?
When the variables to solve for are not provided in the call to solve(), MATLAB calls symvar on the equations, which outputs the...

2 years ago | 4

| accepted

Answered
My function of L-norm doesn't work
f1 and f2 need to be defined as function handles.Notice the updated syntax used in the integrand to integral() as well - f1 = ...

2 years ago | 0

Answered
Pass the text of fprintf to the plot's text
You will need to use sprintf for storing the char array, then using it as inputs to text(). You can either use disp or fprintf ...

2 years ago | 1

| accepted

Answered
how to plot time, force1,force2,voltage1,voltage2 on same graph. keeping force on y axis left hand side and voltage on yaxis right hand side and time on x axis.
Use yyaxis. See the link documentation for examples. For importing data, see - readtable and readmatrix

2 years ago | 0

Answered
Combine Mathlab 2023b and 2021b licenses
You should contact TMW for this issue - Contact Sales

2 years ago | 1

Answered
trying to use syms and i typed in syms('y') says error
If you are using syms, the syntax to define a variable is - syms y whos The sytanx you were using is for a different funct...

2 years ago | 1

| accepted

Answered
Starting with all symbols, ending with mixed symbols and number?
Use subs - syms a b x %Expression y = (a/b)*x; y = subs(y, [a b], [2 3]) If you want the expression in decimal repres...

2 years ago | 1

Answered
An issue with matlabFunction
mu=@(x,par)par(1).*x; sigma=@(x,par)par(2); syms x0 x dt par = sym('par', [1, 2]); LL = -1 / 2 * (log(2 * pi * dt * sigma(x0...

2 years ago | 1

| accepted

Answered
How to connect the plot point using a line in Matlab using For loop for the below mentioned code??
Best to allocate the data in an array first and then plot - v=89.2/60; l=0.313; t=0.05; strain=0.0003537; step = 0.001; ...

2 years ago | 0

| accepted

Answered
Error using stem X must be same length as Y.
The variable n_values has 11 elements, compared 10 elements for x_values, y_values, and expression_result (which is the result o...

2 years ago | 0

Answered
Why does exportgraphics change the figure when exporting an area plot to png?
From the documentation - "exportgraphics(obj,filename) saves the contents of the graphics object specified by obj to a file. The...

2 years ago | 1

Answered
Help with iterations over large file.
If the format of the data is homogenous through the file, try this - in = readlines('ascii.txt') for k=2:5:size(in,1) in...

2 years ago | 0

| accepted

Answered
how to plot x= 0:0.01:10
I'm not sure what are you plotting against, but you will have to specify xticks manually - x = 0:0.01:10; y = sin(x); %Def...

2 years ago | 0

| accepted

Answered
Create a vector (1,25) with values increasing from 0-24
From what I understood, you want to get a row vector having 25 elements with increasing values in the range [0 24]. For that, u...

2 years ago | 0

| accepted

Answered
How to color each group of a bar plot into a different color
%Random data mat = randi(20, 16, 3); %Plot bar graph b = bar(mat); n = size(mat,1); %Get color for each group color = ...

2 years ago | 2

| accepted

Answered
Intersections between two discretised functions
You can use FEX submissions for this, I have run these two submissions below - InterX, intersections as example - You can als...

2 years ago | 1

| accepted

Answered
how to plot different horizontal lines over each group of bar plot
Here's a demo - %Random data mat = randi([11 19], 4, 6); %Bar plot b = bar(mat); hold on %Get the x-coordinates of ea...

2 years ago | 1

Answered
The product of a vector and a matrix
If I understand your question correctly, you should get the desired output using array multiplication - N=5; A = (1:N).' X =...

2 years ago | 1

| accepted

Answered
Imported data becomes combination of number and alphabet for 1 decimal places value
Change the display format - y = 1011.8 format longG y Note that this only changes how a numeric value is displayed, not how...

2 years ago | 0

Answered
hello, i have such a type of data per 30 days in one file.by using fgets,fscanf,str2num,strcmp i need to plot temp vs height
Use readtable to read the data into a table and use indexing to access and thus plot the data using plot

2 years ago | 0

Answered
How can produce this matrix?
M = 3; N = 7; k=2; arr = accumarray([randi(M,1,N); (1:N)].', 1, [M N]) if sum(arr(1,:))<k arr = [ones(1,N);zeros(M-1...

2 years ago | 0

| accepted

Answered
auto update of text in plot
Convert the script to a function (make appropriate change accordingly in doing so) and call the function for different values of...

2 years ago | 0

| accepted

Answered
Create 2D mask from nonzero values in 3D array
Your data does not have any zeros in it. y = load('3Darray.mat') arr = y.FAtp2_DA; any(arr==0, 'all') any(abs(arr)<1e-6, 'al...

2 years ago | 0

| accepted

Answered
Removing the extra part from the figure entered in MATLAB
Use exportgraphics to save the plot to an image file. Description of the function - "exportgraphics(obj,filename) saves the c...

2 years ago | 0

Answered
finding a maximum value in a column of a 2 dimensional matrix
No, that finds the maximum of all values of the 2D matrix. Use indexing to provide the 2nd column of the matrix to max() - y =...

2 years ago | 1

Answered
Plots: aligning categorical y-axis labels
Set the yticks using the values in y and modify the yticklabels of the right y-axis accordingly - If the order of labels is e...

2 years ago | 1

Answered
Numerical Differentiation using Finite Differences
It's because you over-write the variable x as a symbolic variable. Thus you get the aforementioned error. To solve the issue, ...

2 years ago | 1

Load more