Most voted "matlab" questions
MATLAB (Matrix Laboratory) is a high performance interactive software for numerical calculation.
Learn more…123 questions
Sort by count of
-
1
votes0
answers111
viewsAlgorithm involving statistics
I am working on a TCC project that used neural networks in MATLAB as a universal function estimator, having obtained very good results: more than 70% of the samples present a relative error of less…
-
1
votes1
answer205
viewsProblems comparing data from two matrices of different sizes in Matlab
I have a data matrix, with non-leap years, and in which matrix it was separated: Data = [year month data]; Size = 14965 rows and 5 columns And I have an array parameters, to compare with "data1" and…
matlabasked 7 years, 7 months ago Lucas Cesar 11 -
1
votes1
answer5445
viewsExport a datamatrix from Matlab to excel
I have a file with several matrices, as described: Name Value lat <162x168 single> lon <162x168 single> obsData <162x168x4929 double> time <5844x3 double> v6Data…
-
1
votes1
answer1421
viewsCalculation of the divergent rotational of a function in Matlab
I have a college job where I have to create a routine to calculate the divergent rotational of any function in Matlab. Researching, I found that I can use the function divergence() to calculate the…
matlabasked 7 years, 5 months ago Lucas Oliveira 13 -
1
votes0
answers36
viewsI can’t find program error
function [ dy] = dydt( t,y,par ) %UNTITLED10 Summary of this function goes here % Detailed explanation goes here K1D=par(1); C4=par(2); KD=par(3); tetaD=par(4); %procurar valor real T=par(5);…
matlabasked 7 years, 4 months ago Patrícia Vasconselos 11 -
1
votes1
answer50
viewsSolve code in Matlab?
Could someone help me with this problem? I need to multiply an expression by x and get the result. The expression A1 - A1*x + 2*A2*x - A2 x 2 + 3*A3*x 2 - A3*x 3 + 4*A4*x 3 - A4*x 4 + 5*A5*x 4 -…
-
1
votes0
answers119
viewsImage coordinate correction in MATLAB
Good morning, I’m a beginner in the use of MATLAB and I believe you’re having problems with simple questions but a little help would be a great contribution. I’m trying to perform coordinate…
-
1
votes1
answer396
viewsWrong square parentheses (square brackets)?
I have this function in Matlab cn = reshape(repmat(sn, n_rep, 1), 1,[]); in Python I have the following code: import numpy as np from numpy.random import randint M=2 N=2*10**8 ### valor de Dados…
-
1
votes1
answer78
viewsHow to know each pixel of a superpixel in Matlab?
I am doing a program in Matlab using the computer vision addon. I used the superpixel function to get the array of Abels. From what I understand this matrix represents which label (superpixel) each…
-
1
votes2
answers133
viewsHow to read the size of a mat file?
I have a mat file with certain data. It has 10 rows per 500 columns but when I do: matriz = load('Planilha.mat'); disp(size(matriz)); The result is 1 by 20. Which is totally different from the…
-
1
votes2
answers78
viewsLoop step size for MATLAB
I have the following loop in MATLAB, I would like to know how I can increase my k variable from 0.15 to 0.15 until 10. for k=1:1:10 %... end
-
1
votes0
answers83
viewsSet percentage of white and black on a photo worked in BW
I want to know the percentage of what color is most prevalent in the photo. Black or white? ]()…
matlabasked 4 years, 9 months ago Raquel Salamene Salvador 21 -
1
votes1
answer46
viewsCheck if a certain value is in the vector
I created the vector fragil that will accept various inputs from the user, inputs that will (or will not) be the position of other elements in another matrix. I used the following function to create…
-
1
votes0
answers33
viewsHow do I compare matrices of different sizes in Matlab?
I have two matrices with numeric values: A (size 44x1) and B (size 42x1). What I need to do is: count how many times the values appear repeated for A and B. whether these repeating values are common…
-
0
votes1
answer237
viewsCreate a scan window in MATLAB
I’m trying to create in Matlab a script that makes a sub-matrix (search window 3 x 3) go through a larger matrix looking for minimum values for each 3 x 3 cell chunk analyzed. When the script finds…
-
0
votes1
answer1851
viewsCalculation of moving average in MATLAB
How to calculate the average of 12 months of a time series in MATLAB, so that by fixing Jan to ten the year you want the average, the month of Jan of year x is the average of Jan to ten of the year…
-
0
votes1
answer1849
viewsI’m not able to calculate the auto values and auto vectors of a matrix
How do I calculate the eigenvectors and auto values of a matrix in MATLAB?
matlabasked 10 years ago Moallison. 51 -
0
votes1
answer940
viewsRepresent coordinates in Matlab vector
I am having problems creating an object vector in Matlab, the idea is that it is a coordinate vector, i.e. the x and y positions. The goal is to have a vector to access the coordinates in the loops…
-
0
votes2
answers8510
viewsResults in table format in Matlab
When simulating a program in Matlab, it is possible to present the results in table format? Output of the program: Nível de tensão (V): 200.6000 199.5000 231.1000 198.8000 200.6000 200.4000 Data e…
-
0
votes1
answer3663
viewsHow to record the intermediate result of a loop for in matrix, with each iteration?
below follows the attempt of a code to calculate the following situation: I have two vectors: "q_qp" and "pe", I need each element of the vector "pe" to multiply all elements of "q_qp", for example:…
matlabasked 10 years ago Hugo Ribeiro 1 -
0
votes2
answers1947
viewsHow to use function return in Scilab or Matlab?
I’m doing a simple numerical program. But I can’t use return of functions in Scilab someone can help me? The function has to solve a calculation and then return the value for this variable to…
-
0
votes1
answer3219
viewsHow to pass an array to a file . txt - MATLAB
I’m reading an image teste.jpg by command imread and turn it into a gray image by the command rgb2gray. I need the corresponding codes of the result of this matrix, in a file .txt. Follow the…
-
0
votes0
answers19
viewsMatlab error: Too Many Elements
How to read a file. txt that has many elements? For a few elements the dlmread command works, but for large-order matrices it does not.
-
0
votes1
answer707
viewsMATLAB image processing
How to convert an image to grayscale (Gray) to a color image (rgb)? img=im2double(imread('37_M.jpg')); figure(1), imshow(img,[]), title('original'); t=imgaussfilt3(img,0.2); figure(2), imshow(t,[]),…
-
0
votes0
answers64
viewsUndefined variable error
I have this code and it tells me that Spec is not defined in (pcolor(freq,tstart,Spec);colorbar), but I am calculating it in the cycle.. Does anyone understand why the mistake? Thank you! N…
matlabasked 8 years, 8 months ago Sofia Raimundo 537 -
0
votes1
answer1597
viewsPlot a graph of the loading and unloading of a capacitor in MATLAB
I need to create a program that shows through Plot the loading and unloading of a capacitor as shown below: There are 3 constants where the user needs to enter the values: C = capacitance; R =…
-
0
votes0
answers42
viewsAutomatic clock update in Matlab
Does anyone know how to update the clock in the Matlab? I can only update after pressing a button, but I want you to update automatically.
-
0
votes1
answer506
viewsMatlab - how to put an exponent in xlabel
Good afternoon. I want to put on the xlabel the units of m (-1). f=[40.82,52.63,75.80]; inversoL=[1/0.730,1/0.600,1/0.400]; coeficientes=polyfit(inversoL,f,1)…
matlabasked 7 years, 8 months ago Carmen González 243 -
0
votes1
answer134
viewsSyntax problem when compiling modeling in Lingo
I’m trying to solve the modeling of a linear programming exercise in Lingo and every time I have the software compile the code I get the error code: 11. INVALID INPUT. SYNTAX ERROR HAS OCCURRED.…
-
0
votes1
answer96
viewsHow to generate a filter to remove outliers from a time series in Matlab?
would like to create a low-pass filter to remove outliers from a time series. Are sea surface temperature data (tsm), in this series there are some data that are outliers and do not know very well…
-
0
votes1
answer1018
viewstrapeze rule in Matlab!
Good evening. Could someone help me? I need to create a Matlab function that solves integrals by "Composite Trapeze Rule". I know how the "Trapeze Rule" works, but how to do the implementation in…
-
0
votes1
answer222
viewsDivision in the Matlab?
Good evening. Could someone help me? How to show the result of a substitution in Matlab other than in division form? Show decimal form number? 'res' is a variable that holds a polynomial expression…
-
0
votes1
answer69
viewsHow to turn a random vector into an ordered vector without losing correlation in Matlab
Hello, I’m trying to run a power flow program (electrical engineering). The routine works perfectly if the bar number vector is of type: A=[1;2;3;4;5;6;7;8] The problem is that I come across vectors…
-
0
votes1
answer53
viewserror in isempty function
I have a mistake in this role isempty in Matlab, I need when it is empty through a matrix to make the condition after the if isempty: function bn_hat =…
matlabasked 7 years, 2 months ago Sergio Nunes 351 -
0
votes2
answers170
viewsHow to convert Matlab functions to Rstudio?
tempo=Seq; conc=NCelTotais; coef_ini = [MaxCT 1 2]; coef=[]; OPTIONS = optimset('MaxIter',1000,'TolFun',0.001,'TolX',0.01); coef = fminsearch(@funcaoerro_sigmoide,coef_ini,OPTIONS); A=coef(1);…
-
0
votes1
answer357
viewsNo return function in Matlab
I need to do a function in Matlab where it will have no variable as return, only parameters, it is possible?
-
0
votes0
answers74
viewsIs it possible to change a comparison of an existing variable in Matlab?
You can change/change the equality (comparison) of an existing variable in Matlab?. The variable eq of my program has as value the first highlight below. This variable is compared to 0. I want to…
-
0
votes0
answers76
viewsScore critical point on the surface - Matlab
I am making this script to mark the critical point on the surface, only it is giving error : "Error in teste2 (line 26) Plot(Xs(1),Xs(2),'r*')", someone can help me? clc clear H=[2 -2;-2 4];…
matlabasked 6 years, 5 months ago Vinicius Souza 78 -
0
votes1
answer458
viewsMatlab function for ln(1-x) approach
Good morning guys, I need to make a Function according to the image, but I do not have much knowledge with the matlab, Could someone help me ? Thank you !…
matlabasked 6 years, 2 months ago Fabio Dal Zotto 11 -
0
votes1
answer123
viewsError with xlswrite in Matlab 2016
I am having problems saving Matlab data in Excel spreadsheets. I took a very simple example code: A = [1:257;1:257]; [status message] = xlswrite('teste.xls', A) But it doesn’t work. The error that…
matlabasked 6 years, 1 month ago Jônatas Trabuco Belotti 656 -
0
votes0
answers57
viewsError in converting Matlab to python
I intend to convert the following function into Python: Função Matlab cn = reshape(repmat(sn, n_rep, 1), 1,[]); resultado matlab cn = Columns 1 through 23 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 1…
-
0
votes2
answers619
viewsstandard deviation of all elements of a matrix in MATLAB?
How to calculate the standard deviation of all elements of a matrix? the Std function divides by column. How to calculate by all elements?
matlabasked 6 years ago Vitor Bento 43 -
0
votes1
answer92
viewsMATLAB, how to create symbolic variables with FOR?
how do I create several variables with the use of the for in Matlab? I’m not able to link the for index with the name I give the variable for example: For i = 1:10 Syms Variable i; %what do I put…
matlabasked 6 years ago Vinicius Mariz 1 -
0
votes1
answer240
viewsChange of Matlab Directory
I would like to know how I fix this problem; I am using a function block inside Simulink, however when I click to execute my code appears the following error: The Current directory 'c: program files…
matlabasked 5 years, 11 months ago Felipe Vieira 21 -
0
votes1
answer231
viewsHow to return output argument in Matlab?
I created a function to calculate a linear system with 5 unknowns (A1 to A5), which has as an output argument 'Ai' and input 'A and b' which are respectively a Matrix and Vector. The values of A and…
-
0
votes1
answer272
viewsHow to plot this signal in Matlab?
I wanted to plot these signals in Matlab to make a series of Urier, but I’m not getting it. Does anyone know what the mistake is? Also, how do I include the imaginary unit? I put as 1j but I don’t…
matlabasked 6 years, 7 months ago Lucas Matos Molter 3 -
0
votes1
answer39
viewsStop a worker and continue the Parallel pool in Matlab
I have a code with a parfor simple in Matlab that calls the Workers. parfor valor= 1:fim [output, out] = Computacao(dado1, dado2, int32(valor)); end within the function that is called have an if for…
-
0
votes1
answer646
viewsHow to increase the size of a vector while maintaining its original shape? MATLAB
I have two vectors, one has vector X of 729 elements and the other vector Y 429 elements, but I needed to assemble a graph (vector X, vector Y), however they have different sizes and this is not…
-
0
votes1
answer737
viewsPlot function in PYTHON or MATLAB
People need to plot a function and I can not find cool tools for it, because the function has by definition constant, and I thought to use a programming language for this, but I do not know python ,…
-
0
votes0
answers53
viewsHow to find Threshold values in an image in Matlab?
how to find Threshold values in an image, with the following ranges: 0-0,25, 0,25-0,50,0,50-0,75 and 0,75-1? And could you tell me what the following code does please: GRAY = mat2gray(bEnhanced); %…
matlabasked 6 years, 2 months ago Catarina Leitão 1