Beantwortet
add internal parts of a vector
Here is a simple way of dividing the data into groups of 1 and counting the number of elements for each sub-group - %Converted ...

mehr als 2 Jahre vor | 2

| akzeptiert

Beantwortet
I am not getting a graph for my matlab program but I can run a program . I am attaching my file. can anyone help me with this?
There's no need of initialize the variables as globals, so remove that line. Also, the ode call needs to be outside the functio...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
Deleting rows with identical time from .mat file variable
You have written your code with the assumption that the times are the same/identical, which it might look like but that isn't th...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Determine value in the 3rd column of a matrix based on the first and second column values
Use ismember - M = [3 2 10; 4 3 4; 3 1 3; 2 1 12; 2 2 10; 4 1 18; 4 2 12]; job = 3; machine = 2; idx = ismember(M(:,1:2...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Error in kinematics (line 22) disp(['Initial velocity: ', num2str(solu), ' m/s'])
The output from solve() will be a symbolic number. And symbolic numbers are not accepted as inputs to num2str, see at the end. ...

mehr als 2 Jahre vor | 0

Beantwortet
PLOT SYMBOLS/MARKER FOR TWO SET OF ARRAYS IN A CONTOUR
Use plot to add markers - X = linspace(-2*pi,2*pi,10); Y = linspace(0,4*pi,10); Z = sin(X) + cos(Y).'; contourf(X,Y,Z) hol...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
MATLABを用いて二段階で範囲を指定したい場合
xlsread() is a deprecated function, it is not recommended to use. Utilise readmatrix instead. Use logical indexing instead of f...

mehr als 2 Jahre vor | 1

Beantwortet
How can I read in 100 image files from my folder titled "Images"?
See - https://in.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html

mehr als 2 Jahre vor | 1

Beantwortet
Shortcut for applying two functions to two arrays.
Vectorization ftw! f = @(x) [exp(x(1,:)); sin(x(2,:))]; vec = [1 3 5; 2 4 6]; out = f(vec)

mehr als 2 Jahre vor | 1

Beantwortet
find similar numbers within a matrix
isequal or eq, == are not the best choices when comparing floating point numbers. arr = load('M.mat') M = arr.M; P = [-3.49...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
xline - draw a partial line
You will have to do that manually - %Sinosuidal data for example x = 0:0.01:10; y = sin(x); plot(x, y, 'LineWidth', 2) ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to use fsolve to solve matrix equations involving matrices of different dimensions?
% Calibration sigma = 1; kappa = 0.2; beta = 0.99; phi_pi = 1.5; phi_x = 0.5; sigma_i = 0.0025; sigma_g = 0.0025; sigma_...

mehr als 2 Jahre vor | 0

Beantwortet
Warning using integral function: Function behaves unexpectedly on array inputs
Set the 'ArrayValued' property to 1 for the integral, so that it evaluates the integral of an array/vector valued function/integ...

mehr als 2 Jahre vor | 2

| akzeptiert

Beantwortet
colorbar not working?
"Any idea why the plot comes up all black?" Because your mesh is extremely dense. I have increased the mesh density by 5 times,...

mehr als 2 Jahre vor | 0

Beantwortet
setting axes to a specific colour
You have to call gca first and assign it to the variable ax, and then modify the properties. Otherwise ax will be defined as a ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
fast evaluation of x(k+1) = x(k)*e(k)
Timings of for loop with preallocation and vectorization are comparable for a large number of elements - x = 69420; N = 5e6; ...

mehr als 2 Jahre vor | 1

Beantwortet
How to make the arrow smaller quiver
The arrow head looks wide because the scales of the axes are skewed. When you modify the axis, you can see that the arrowhead i...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Categorizing range of data
Because the for loop only iterates through the last element of phsangSE, thus the rest of the elements are undefined as that's h...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How can I convert cell array to an arrary matrix?
in = load('cell_array.mat') x = in.ans; out = vertcat(x{:}).'

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Mysort script error issue
Remove the clear all, close all, clc line. You generally don't need to use those commands, specially not inside a function. ...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
something wrong in fit function
You can use either a cell array of char vectors or string array for multiple coefficients (or dependent/independent variables fo...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Unrecognized function or variable 'importfile'.
readtable works on the text file - T = readtable('2_ISTA00TUR_R_...1D_30S_MO.txt', 'Delimiter', ' ', ... 'ConsecutiveDel...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to solve this code error? (Diffusion_equation with pedpe)
Modify the function to provide D1, D2 and a as inputs and update the pdepe() call accordingly as well - % define the parameter...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Is this a correct way of 3D graphing an equation with summation
It is better to let the expression be defined as a symbolic expression through-out calculations, then convert it to an anonymous...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
why matlab can't plot signals ?
Because there's a typo, semi-colon instead of colon in defining t. % v t=0: 0.0001;0.1; t t here is a scalar, whi...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Test the Chebyshev Function by plotting the 13th order Chebyshev polynomial but return with wrong graph
Given the recurrence definition used, you are trying to plot the 13th order Chebyshev polynomial of the 1st kind. In that parti...

mehr als 2 Jahre vor | 1

Beantwortet
How to place a global legend into an empty tile in a tiled layout?
Yes, you can place the legend in the empty tile by specifying the tile number. Here's a demo - %Plotting random data in the f...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
I have a 64*64 block matrix, each block of size 4*4. I need to extract the diagonals of each block as a vector.
You can store them in an array, where each column represent the diagonal of each block. (I have assumed that the 64*64 blocks a...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
using readtable on a csv file where some rows have partially missing data
Specify comma as the delimiter - T = readtable('climate_hourly_MB_5060600_2000_P1H.csv', 'delimiter', ',')

mehr als 2 Jahre vor | 0

| akzeptiert

Gelöst


Create rectangular function.
Rectangular function - Wikipedia

mehr als 2 Jahre vor

Mehr laden