Questions tagged [matlab]

Programming questions about MATLAB are off topic and should be asked on Stack Overflow. MATLAB is a high-level language and interactive programming environment developed by MathWorks. It is the foundation for a number of other tools, including Simulink and various toolboxes that extend the core capabilities.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Need Specific Function Argument Structure in MATLAB [migrated]

There's a certain library that I'm using in MATLAB that requires the input function to be defined as a function with 2 arguments. That is function = @(x, y) ... However, I want to return a variant ...
0
votes
0answers
5 views

How to do trajectory optimization using fmincon in MATLAB? [migrated]

I want to plan the trajectory of the cart pole system by using direct collocation method in MATLAB. I understood the algorithm but cannot understand how to code it properly. The objective function is ...
0
votes
0answers
27 views

How to change the current folder in Matlab?

I installed MATLAB but when I open it, it always starts at "C:\Windows\System32" folder but when I use "userpath" command it shows "C:\Users\Home\Documents\ MATLAB". How can I fix this problem?
0
votes
0answers
24 views

Plot a velocity profile in matlab

In my code below I want to plot the velocity profile in 3d for pipe with redius R. I get the plot but the problem is the velocity shows zero value just at the 4 corner not in a circle. So I used the ...
-1
votes
1answer
28 views

How can I solve the Error: 358 when activating MATLAB R2019b?

"Error 358: The license file expiration date has passed. In order to activate this license, the license file expiration date must be set to a future date."
0
votes
0answers
20 views

MATLAB - Diagnostic Feature Explorer

While trying to import data in diagnostic feature explorer application, I am getting the following error. How to fix this? Warning: Error occurred while executing the listener callback for event ...
56
votes
12answers
27k views

Can I run my CPU at 100% usage for a long time?

I have a Dell XPS 15 9570, 32 GB ram, 2.2 ghz and 6 cores. When i use an application (The parsim command on MATLAB) (for more details) then my fan starts running fast , during this my PC doesn't seem ...
1
vote
1answer
57 views

Merge 3 .csv into one file with different number of columns

I have 3 .csv files and I want to merge them together to one .csv file which can be in R or Matlab. The files are: 1597 obs of 167 variables; 160 obs of 167 variables; 533 obs of 146 variables I ...
1
vote
1answer
22 views

Matlab refuses to compute a limit [closed]

I have some function handle which has a variable input x, along with some parameters. I am trying to compute the limit when x goes to zero from above of that function, for different values of the ...
0
votes
1answer
32 views

MatLab showing different plots on different zoom level

I ran this code on MatLab: function main fimplicit (@(x,y)f(x,y),[2 5]) end function fun = f(x,y) nc=1.45; %cladding nf=1.5; ns=1.4; %substrate h=5; %width of waveguide kappa=sqrt(x^2*nf^2-y.^...
0
votes
0answers
35 views

Need help deriving association rules from frequent item sets (Apriori Rule) in Matlab

I'm fairly new to working with Matlab and have been tasked with generating association rules given frequent item sets in Matlab. I'm well aware of the theory behind the Apriori algorithm but it seems ...
2
votes
1answer
66 views

How to get different color for different branches in a plot in MatLab, Mathematica and Desmos

I am trying to obtain slab-waveguide dispersion plot like this (dashed line): I tried following code in Matlab: function main fimplicit (@(x,y)f(x,y),[0 10]) end function fun = f(x,y) nc=1.45; %...
2
votes
1answer
19 views

Linking JVM languages other than Java with Matlab

I'm aware that it's possible to link Java programs with Matlab. Is it therefore possible to link any JVM languages with Matlab? I would suspect that's the case -- presumably Matlab can't tell and ...
0
votes
1answer
24 views

Values of Components in a Matlab app are not updated while a loop is running

I have created an app using the App Designer in Matlab. I have a check box called CheckBox and want to access its value from inside a loop, e.g. display it in the console. The way this could be done ...
0
votes
0answers
15 views

Matlab R2019b hangs on startup on macOS when Contexts is running

I'm running Matlab R2019b on macOS 10.14.6. When Contexts is also running, Matlab hangs upon startup: the desktop GUI pops up, but is unresponsive, and the cursor becomes a beachball. I've reported ...
0
votes
0answers
14 views

Editing Specific numbers in a .txt file with matlab GUI

I have a bunch of different template .txt files that I want to be accessed by a user in matlab. these templates look like this, but with key differences that I will explain: LOAD BOX 1 SUBJ ...
0
votes
1answer
35 views

MATLAB: Growing an array and logical indexing

I create the following array in MATLAB: Now I find which elements of x are greater than 4: So far so good. Now I create an array of length 8: And now I execute this command: I am very confused as ...
0
votes
0answers
6 views

MATLAB version compatibility & artifact compatibility evaluation

MATLAB functions and tool capabilities (i.e. Live Nootbook, Simulink) are introduced and retired when a new version is released. Mathworks is generally good about ensuring that older .m & .mlx ...
0
votes
0answers
8 views

editing a macro with user input in matlab

I have 4 macros on on my system. each one is short, and contains the same basic code: LOAD BOX 1 SUBJ M1_299633_D295158_JUN19@1910_Aut_ERROR2 EXPT St2_Se4_Rat1 GROUP 1 PROGRAM ...
0
votes
0answers
45 views

Could not access the MATLAB Runtime component cache

I am running a matlb program compiled for windows on debian / linux. I have installed the Matlab runtime for windows on the machine using wine. Currently when i try to run the program using wine by ...
0
votes
2answers
59 views

Matlab solve command gives four equations instead of 2 real solutions

I am trying to solve the following equation:x^4 - 3*x^3 + x^2 - 1 by doing: solve(x^4 - 3*x^3 + x^2 - 1 == 0) I am expecting either two real solutions or four solutions where two of them are real and ...
0
votes
0answers
24 views

GNU Octave publish function is causing a core dump

I have been trying to use Octave for my assignments, which require you to publish your code in a .pdf file. Doing this in matlab has been fine, but whenever I tried to in octave-gui, it would just ...
0
votes
0answers
10 views

Problems publishing in MATLAB

I have a long script, about 10 questions, when I publish the script to PDF format, for each question up to Q8, the relevant tables and figures show up in the pdf. However for Q9 and 10, the pdf just ...
0
votes
0answers
164 views

Problems with UDP protocol in Matlab Simulink

I will go straight to the point, I am working with Matlab 2017b on a standard computer to which I installed simulink real-time packets, in this there are two blocks called "Packet Output" (3) and "...
0
votes
0answers
5 views

Matlab not recognising supposedly inbuilt function

Using Matlab R2019b wanting to return the number of edges and nodes in a biograph. The commands are not recognised and it is unfortunately not taking me anywhere to download a package or add-on. I ...
0
votes
1answer
28 views

“gcs” returns nothing in MATLAB

After I restarted my PC and then re-opened a .m script I was working on, that for some reason broke it. gcs for some reason returns 0×0 empty char array when it's supposed to return the pathname of ...
0
votes
0answers
27 views

Breaking an image into TIFF frames using MATLAB results in compression?

I have a piece of analysis software that requires images in uncompressed TIFF format to work properly; unfortunately, they are in AVI, so I've been breaking them up using MATLAB. vid = VideoReader('...
0
votes
1answer
17 views

Matlab syntax (1:end-1) - Explanation

Could someone explain me this code? meas.jerk.time = (meas.acc.time(1:end-1) + meas.acc.time(2:end)) ./ 2; Assuming that meas.acc.data and meas.acc.time are vectors with the same number of elements, ...
0
votes
0answers
18 views

MATLAB - Error using interp1>reshapeAndSortXandV X and V must be of the same length

I geht this error message when I try to derive my acceleration of the car. I think there is a size problem, but I don't know how to solve it. The data is measured from a car. meas.jerk.data = diff(...
1
vote
0answers
25 views

Opening MATLAB scripts by double click on linux

I associated '.m scripts with Matlab, but still, I have a problem. When I open two files of this type, I open 'two Matlabs' also. I want to have a similar result as in Windows. I open two scripts, ...
0
votes
0answers
21 views

Can I do matrix operations over different fields in MatLab?

I have some matrices with entries in the field F_3 (the field consisting of only 3 elements). I was wondering if it is possible to use MatLab to do operations with them? Thanks.
0
votes
0answers
12 views

MATLAB output array

I'm a beginner and I got a Script and I have to out put RES{1} and RES{2} RES{ii,1} = measure; RES{ii,2} = measure_filter; measure and measure_filter will be filled before. But I don't know how to ...
0
votes
0answers
15 views

Is there a method to prevent minimizing or closing a dialog box in windows 7, 8, and 10 until a matlab script has finished?

what I want is to somehow disable the little x button or minimization button in the upper right hand corner of a dialog box. I have a GUI running in matlab, I want this GUI to be locked to the screen ...
0
votes
0answers
14 views

Mixing up transfer function block is generating anomalies

I'm using simulink to simulate a simple control problem, as you can see in the image below. Simulation 1 My goal is to compare this diagram with a transfer function that I calculated and see both ...
0
votes
0answers
33 views

How to plot a program file's inputs and outputs on MATLAB

I wrote a code on the Eclipse IDE in C that calculates the inputs and outputs of a Fourier Sine Series. I ran the code in the Cygwin Terminal and got the outputs I expected. I then wanted to make a ...
0
votes
0answers
109 views

learning how to use MATLAB App designer, integrating existing code into GUI

I found a MATLAB script online, and played with it a bit until I got it to do what I needed it to. Essentially, I have an alphanumeric tag stored in an excel file, and the MATLAB code compares the ...
0
votes
1answer
33 views

MATLAB: recall previous command and ADD it to what I typed (similar to bash)

On the MATLAB commandline, I can recall the previous command with the UP arrow. However, if I already have typed something and then hit UP arrow, only commands beginning with what I already typed will ...
0
votes
0answers
46 views

Can SUMO be combined with MATLAB to simulate the transportation?

I am recently using SUMO to simulate the urban transportation, I also want to combine it with MATLAB. But I don't know if it is feasible. Has anyone tried this before?
0
votes
0answers
15 views

Python library available in Matlab, but will not import to python?

I am trying to coregister two sensors in either Python or Matlab, but have run into a weird issue. If I open a command prompt or terminal and use python, I cannot access the library. I have tried ...
0
votes
0answers
20 views

'Undefined variable “matlab” or class “matlab.addons.installedAddons”' when running launch.m in MATLAB

I want to control a robot using MATLAB in Webots 2019a. When I start the simulation using launch.m, it always fails. The information of the error is: Undefined variable "matlab" or class "matlab....
0
votes
1answer
17 views

How to make an application “recognized” as an application

I'm using ubuntu and i3 window manager. To launch matlab I have to navigate to /usr/local/MATLAB/R2019a/bin and type ./matlab. Other applications like firefox and atom are recognized as ...
1
vote
0answers
26 views

Here HDLM in Matlab, App ID and App code credentials validation

I created a Freeminum account in Here technologies website and generated the App ID and App code. I tried to use those credentials in the HERE HDLM feature in the Automated driving Toolbox in Matlab. ...
0
votes
0answers
74 views

How to install WFDB package in MATLAB and can you please give some examples related to its usage?

[old_path]=which('rdsamp');if(~isempty(old_path)) rmpath(old_path(1:end-8)); end wfdb_url='https://physionet.org/physiotools/matlab/wfdb-app-matlab/wfdb-app-toolbox-0-10-0.zip'; [filestr,status] = ...
0
votes
0answers
16 views

Simulink Error: more than 1000 non-virtual blocks

I am usng project referencing to run my simulations and I got an error saying I have more than 1000 non virtual blocks. This seems highly unlikely as I was able to run the same model a versions back, ...
0
votes
0answers
5 views

Error with RK4 method for First- order ODE

Can someone explain why isnt this code working? I am a beginner and haven't been able to figure out yet. %Code to solve system of ODE's describing dynamics of Malaria in humans due %to mosquitos ...
0
votes
0answers
41 views

MATLAB Simulink: Exceed 1000 non virtual block limit

For my simulink model, I get an error saying I have exceeded using 1000 non virtual blocks. However, inreality, I am using far less than that. How do I get rid of this error? length(find_system('...
0
votes
1answer
37 views

Is there any way to tell MATLAB to close/exit all open executables/MEX files?

I am currently working on a project that uses MATLAB and MEX files. I frequently make changes to the MEX source files for testing, and then go to replace these files with my newly-compiled ones. ...
0
votes
1answer
33 views

Assistance with forming normal vectors on the graph

I am doing an assignment question link to image I am trying to find the normal vectors to my 'ice-cream' cone curve, which consists of a part cone and part sphere. I need help with the code because I ...
0
votes
0answers
37 views

BCILAB not running in MATLAB

I'm facing a problem when running BCILAB in MATLAB. I already tried BCILAB 1.1 and 1.2.  I even tried other MATLAB versions like 2015, 2017 and this one 2018a. actually, the error message is soo ...
0
votes
0answers
31 views

Matlab fit function not accepting “numeric” data type

This is driving me crazy, I'm just trying to fit a gaussian curve to some data using Matlab's fit function (r2017a). gaussEqn = 'a*exp(-((x-b)/c)^2)+d' f = fit(x,y,gaussEqn); But I get this error: ...

1
2 3 4 5 6