已回答
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...

2 years 前 | 0

已回答
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...

2 years 前 | 0

已回答
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...

2 years 前 | 0

| 已接受

已回答
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.

2 years 前 | 0

| 已接受

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

2 years 前 | 0

| 已接受

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

2 years 前 | 2

| 已接受

已回答
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...

2 years 前 | 1

| 已接受

已回答
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...

2 years 前 | 0

已回答
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...

2 years 前 | 0

已回答
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...

2 years 前 | 0

已回答
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...

2 years 前 | 1

| 已接受

已回答
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, ...

2 years 前 | 0

| 已接受

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

2 years 前 | 0

| 已接受

已回答
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...

2 years 前 | 0

| 已接受

已回答
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...

2 years 前 | 0

已回答
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 ...

2 years 前 | 0

| 已接受

已回答
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....

2 years 前 | 0

已回答
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 ...

2 years 前 | 0

已回答
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 ...

2 years 前 | 0

已回答
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...

2 years 前 | 0

| 已接受

已回答
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 = ...

2 years 前 | 0

提问


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 -...

2 years 前 | 1 个回答 | 0

1

个回答

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

3 years 前 | 0

提问


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...

3 years 前 | 3 个回答 | 0

3

个回答