Respondida
X, Y label disappeared in app designer after exporting?
Hi, I guess you should check which callback function is associated with your button, maybe this button plots the figure again w...

casi 2 años hace | 0

Respondida
Convert for loop Matlab in python
The equivalent of for i = start:step:finish % do something end is for i in range(start, finish+1,step): #do some...

casi 2 años hace | 0

Respondida
How to convert a string into a variable name and assign it a cell of data?
You can use the function eval, although it is not recommanded. For example doing something like: eval([strVarName '=' strVarVa...

casi 2 años hace | 0

| aceptada

Respondida
How to convert the simulink model to s-function
As said on the error, you must install the compilers on the given link. Then you will be able to generate your S function.

alrededor de 2 años hace | 0

| aceptada

Respondida
Copy an image (to be selected with a parameter) from one folder to another
filePattern = fullfile(origin_folder, ['name of figure' num2str(k) '.jpg']);

alrededor de 2 años hace | 0

| aceptada

Respondida
How to generate distincted distanced coordinates?
x = [0:50:1000]; y = [0:50:1000]; [xGrid,yGrid] = meshgrid(x,y);

alrededor de 2 años hace | 2

| aceptada

Respondida
How to find the maximum element by length without a loop?
arrayStr = [a,b]; [~,i] = max(strlength(arrayStr)); maxStr = arrayStr(i); Careful, that works only if a and b are strings, it...

alrededor de 2 años hace | 1

| aceptada

Respondida
Plotting time in hours
You have one line per hour so you can use directly the line index as your time series and plot the associated variable according...

alrededor de 2 años hace | 0

Respondida
How to find number of input and output ports of an unknown simulink model ?
Hi, You need to use the function get_param with 'Ports' as a parameter, for each subsystem of your model. The first and second...

alrededor de 2 años hace | 0

Respondida
How to load data into a function
Hi, If data is a variable, you must include it as a input of your function function [z] = hello(x,y,data) load(data) %Rest o...

alrededor de 2 años hace | 0

Respondida
How can I make my function plot lines to make a rectangle?
Hi, Your function just plots one point. You need to plot all the points of your rectangle, and closing it by returning at the f...

alrededor de 2 años hace | 1

| aceptada

Respondida
move txt file from one folder to another
Hi, There is an error in your code, you've added quotes around your variable name. This should work. A = 300; writematrix(A, ...

alrededor de 2 años hace | 0

| aceptada

Respondida
How can I load different simulink model blocks into new simulink model using Matlab scripts ?
Hi, Check add_block: add_block

alrededor de 2 años hace | 0

| aceptada

Respondida
How to create personalized colormap that starts from a specified value
Hi If Z is the map you plot, you can replace all the negative values by 0 like that : Z = [0 1 8; -1 5 10;-6 -3 14] Z_nega...

alrededor de 2 años hace | 0

| aceptada

Respondida
Why a field is replaced by next field when corresponding function is being called within a loop?
Hi, You're using the same [SL_CI,DL_CI] to store both fields, so the last one override the first one. You should have storing...

alrededor de 2 años hace | 0

Respondida
Getting just the time in Date-time cell
Hi for i = 1:length(txt(:,1)) if ~isempty() txtSplit = strsplit(txt{i,1},' '); txt{i,2} = txtSplit{2}; end The value ...

alrededor de 2 años hace | 0

| aceptada

Respondida
Repeatedly call a function in App Designer while working with the App
Hi Have a look a these: https://uk.mathworks.com/help/matlab/matlab_prog/use-the-background-to-make-your-apps-more-responsive....

alrededor de 2 años hace | 0

Respondida
find Maximum values in intervals of time(each 2000 values)
Hi, I would do something like that for i = 1:(length(u)-1)/2000 maxArray(i) = max(u((i-1)*2000+1:i*2000)); end You'll ...

alrededor de 2 años hace | 0

Respondida
Predict power consumption using linear regression
Hi, You can use the function polyfit with x being the time and y being the power consumption, you will have to choose n to fit ...

alrededor de 2 años hace | 0

Respondida
How to multiply two cell array
Hi, C = {}; A={1,2,3}; B={'a','b','c'}; for i = 1:length(A) for j = 1:length(B) C{end+1} = {A{i},B{j}}; e...

alrededor de 2 años hace | 0

| aceptada

Respondida
how to debug the non-working of real() function?
Hi, I guess sinr_los1 is your matrix ? Could you share the inputs and the outputs ? Because both solutions should work M = ...

alrededor de 2 años hace | 0

Pregunta


fopen always open the file even when it is already open
Hi, fopen is supposed to return -1 when it can't open the file. So I thought when I had the file open already it would return -...

alrededor de 2 años hace | 1 respuesta | 0

1

respuesta

Respondida
Why two variables loading the same .mat file are not equal ?
I finally used isequaln to get the result I wanted, thank you all.

casi 3 años hace | 0

Pregunta


Why two variables loading the same .mat file are not equal ?
Hi, I found something weird today and couldn't find an explanation on the forum. When I load the same matlab file twice, and t...

casi 3 años hace | 3 respuestas | 0

3

respuestas